답안 #148328

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148328 2019-09-01T01:29:34 Z 퍼솔하나만...(#3773, jjwdi0) Play Onwards (FXCUP4_onward) C++17
컴파일 오류
0 ms 0 KB
#include "make.h"

std::string MakeWord(int N, int M, std::vector<std::string> Dict) {
	string res;
	for(int i=0; i<M; i++) res += "a";
	return res;
}
#include "guess.h"

std::string GuessWord(int M, std::string YH){
	string res;
	for(int i=0; i<M; i++) res += "a";
	return res;
}

Compilation message

make.cpp: In function 'std::__cxx11::string MakeWord(int, int, std::vector<std::__cxx11::basic_string<char> >)':
make.cpp:4:2: error: 'string' was not declared in this scope
  string res;
  ^~~~~~
make.cpp:4:2: note: suggested alternatives:
In file included from /usr/include/c++/7/string:39:0,
                 from make.h:3,
                 from make.cpp:1:
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
   typedef basic_string<char>    string;
                                 ^~~~~~
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
make.cpp:5:25: error: 'res' was not declared in this scope
  for(int i=0; i<M; i++) res += "a";
                         ^~~
make.cpp:5:25: note: suggested alternative: 'free'
  for(int i=0; i<M; i++) res += "a";
                         ^~~
                         free
make.cpp:6:9: error: 'res' was not declared in this scope
  return res;
         ^~~
make.cpp:6:9: note: suggested alternative: 'free'
  return res;
         ^~~
         free

guess.cpp: In function 'std::__cxx11::string GuessWord(int, std::__cxx11::string)':
guess.cpp:4:2: error: 'string' was not declared in this scope
  string res;
  ^~~~~~
guess.cpp:4:2: note: suggested alternatives:
In file included from /usr/include/c++/7/string:39:0,
                 from guess.h:2,
                 from guess.cpp:1:
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
   typedef basic_string<char>    string;
                                 ^~~~~~
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
guess.cpp:5:25: error: 'res' was not declared in this scope
  for(int i=0; i<M; i++) res += "a";
                         ^~~
guess.cpp:5:25: note: suggested alternative: 'free'
  for(int i=0; i<M; i++) res += "a";
                         ^~~
                         free
guess.cpp:6:9: error: 'res' was not declared in this scope
  return res;
         ^~~
guess.cpp:6:9: note: suggested alternative: 'free'
  return res;
         ^~~
         free