记录详情

Compile Error

foo.cc:4:11: error: 'string' was not declared in this scope; did you mean 'std::string'?
    4 | bool ifin(string a, char b) {
      |           ^~~~~~
      |           std::string
In file included from /nix/store/n19qjv3wanlki2nfwzr53mwc4qxk5vhn-gcc/include/c++/11.3.0/string:39,
                 from foo.cc:1:
/nix/store/n19qjv3wanlki2nfwzr53mwc4qxk5vhn-gcc/include/c++/11.3.0/bits/stringfwd.h:79:33: note: 'std::string' declared here
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
foo.cc:4:21: error: expected primary-expression before 'char'
    4 | bool ifin(string a, char b) {
      |                     ^~~~
foo.cc:4:27: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | bool ifin(string a, char b) {
      |                           ^
foo.cc:12:1: error: 'string' does not name a type; did you mean 'stdin'?
   12 | string h[5];
      | ^~~~~~
      | stdin
foo.cc:13:8: error: 'string' was not declared in this scope; did you mean 'std::string'?
   13 | bool r(string l) {
      |        ^~~~~~
      |        std::string
In file included from /nix/store/n19qjv3wanlki2nfwzr53mwc4qxk5vhn-gcc/include/c++/11.3.0/string:39,
                 from foo.cc:1:
/nix/store/n19qjv3wanlki2nfwzr53mwc4qxk5vhn-gcc/include/c++/11.3.0/bits/stringfwd.h:79:33: note: 'std::string' declared here
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
foo.cc: In function 'int main()':
foo.cc:64:21: error: 'h' was not declared in this scope
   64 |         std::cin >> h[i];
      |                     ^
foo.cc:68:14: error: 'r' cannot be used as a function
   68 |         if (r(l)) {
      |             ~^~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1004 骰子与字母
语言
C++
递交时间
2022-10-10 08:49:36
评测时间
2022-10-10 08:49:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes