/ Vijos /

记录详情

Compile Error

foo.cc:3:7: error: expected nested-name-specifier before 'std'
    3 | using std namespace;
      |       ^~~
foo.cc:5:10: error: 'string' was not declared in this scope; did you mean 'std::string'?
    5 | bool cmp(string a, string b){
      |          ^~~~~~
      |          std::string
In file included from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/iosfwd:39,
                 from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ios:38,
                 from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ostream:38,
                 from iostream:39:
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/stringfwd.h:77:33: note: 'std::string' declared here
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
foo.cc:5:20: error: 'string' was not declared in this scope; did you mean 'std::string'?
    5 | bool cmp(string a, string b){
      |                    ^~~~~~
      |                    std::string
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/stringfwd.h:77:33: note: 'std::string' declared here
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
foo.cc:5:28: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | bool cmp(string a, string b){
      |                            ^
foo.cc:21:1: error: 'string' does not name a type; did you mean 'stdin'?
   21 | string z;
      | ^~~~~~
      | stdin
foo.cc: In function 'int main()':
foo.cc:24:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   24 |         cin>>z;
      |         ^~~
      |         std::cin
iostream:60:18: note: 'std::cin' declared here
foo.cc:24:14: error: 'z' was not declared in this scope
   24 |         cin>>z;
      |              ^
foo.cc:27:9: error: 'string' was not declared in this scope; did you mean 'std::string'?
   27 |         string w[1001];
      |         ^~~~~~
      |         std::string
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/stringfwd.h:77:33: note: 'std::string' declared here
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
foo.cc:29:22: error: 'w' was not declared in this scope
   29 |                 cin>>w[i];
      |                      ^
foo.cc:32:14: error: 'w' was not declared in this scope
   32 |         sort(w,w+n);
      |              ^
foo.cc:32:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   32 |         sort(w,w+n);
      |         ^~~~
      |         short
foo.cc:34:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   34 |                 cout<<w[i]<<endl;
      |                 ^~~~
      |                 std::cout
iostream:61:18: note: 'std::cout' declared here
foo.cc:34:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   34 |                 cout<<w[i]<<endl;
      |                             ^~~~
      |                             std::endl
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ostream:688:5: note: 'std::endl' declared here
  688 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1500 笨笨的单词排序
语言
C++
递交时间
2023-08-15 16:24:38
评测时间
2023-08-15 16:24:38
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes