记录详情

Compile Error

foo.cc:4:1: error: ‘string’ does not name a type; did you mean ‘stdin’?
    4 | string PalindromicString(string str){//目前还有BUG
      | ^~~~~~
      | stdin
foo.cc: In function ‘int main()’:
foo.cc:22:9: error: ‘string’ was not declared in this scope; did you mean ‘std::string’?
   22 |         string str;
      |         ^~~~~~
      |         std::string
In file included from /nix/gcc-13.2.0/include/c++/13.2.0/iosfwd:41,
                 from /nix/gcc-13.2.0/include/c++/13.2.0/ios:40,
                 from /nix/gcc-13.2.0/include/c++/13.2.0/ostream:40,
                 from iostream:41:
/nix/gcc-13.2.0/include/c++/13.2.0/bits/stringfwd.h:77:33: note: ‘std::string’ declared here
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
foo.cc:23:15: error: expected ‘;’ before ‘res’
   23 |         string res;
      |               ^~~~
      |               ;
foo.cc:24:9: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
   24 |         cin>>str;
      |         ^~~
      |         std::cin
iostream:62:18: note: ‘std::cin’ declared here
foo.cc:24:14: error: ‘str’ was not declared in this scope; did you mean ‘std’?
   24 |         cin>>str;
      |              ^~~
      |              std
foo.cc:25:9: error: ‘res’ was not declared in this scope
   25 |         res=PalindromicString(str);
      |         ^~~
foo.cc:25:13: error: ‘PalindromicString’ was not declared in this scope
   25 |         res=PalindromicString(str);
      |             ^~~~~~~~~~~~~~~~~
foo.cc:26:9: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
   26 |         cout<<res<<endl;
      |         ^~~~
      |         std::cout
iostream:63:18: note: ‘std::cout’ declared here
foo.cc:26:20: error: ‘endl’ was not declared in this scope; did you mean ‘std::endl’?
   26 |         cout<<res<<endl;
      |                    ^~~~
      |                    std::endl
/nix/gcc-13.2.0/include/c++/13.2.0/ostream:735:5: note: ‘std::endl’ declared here
  735 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~

信息

递交者
类型
递交
题目
回文判断
语言
C++
递交时间
2024-05-06 17:07:58
评测时间
2024-05-06 17:07:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes