/ OPS /

记录详情

Compile Error

/in/foo.cc:2:7: error: expected nested-name-specifier before 'namespae'
    2 | using namespae std;
      |       ^~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:6:5: error: 'string' was not declared in this scope; did you mean 'std::string'?
    6 |     string str1,str2;
      |     ^~~~~~
      |     std::string
In file included from /usr/include/c++/9/iosfwd:39,
                 from /usr/include/c++/9/ios:38,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from /in/foo.cc:1:
/usr/include/c++/9/bits/stringfwd.h:79:33: note: 'std::string' declared here
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/in/foo.cc:8:8: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |  while(cin>>str1>>str2){
      |        ^~~
      |        std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:75,
                 from /in/foo.cc:1:
/usr/include/c++/9/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;  /// Linked to standard input
      |                  ^~~
/in/foo.cc:8:13: error: 'str1' was not declared in this scope
    8 |  while(cin>>str1>>str2){
      |             ^~~~
/in/foo.cc:8:19: error: 'str2' was not declared in this scope
    8 |  while(cin>>str1>>str2){
      |                   ^~~~
/in/foo.cc:12:9: warning: init-statement in selection statements only available with '-std=c++17' or '-std=gnu++17'
   12 |      if(str1[i+j]!=str2[j] {
      |         ^~~~
/in/foo.cc:16:18: error: expected ')' before ';' token
   16 |         flag=true;
      |                  ^
      |                  )
/in/foo.cc:12:8: note: to match this '('
   12 |      if(str1[i+j]!=str2[j] {
      |        ^
/in/foo.cc:16:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   16 |         flag=true;
      |         ~~~~^~~~~
/in/foo.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |   cout<<(flag?"Yes":"No")<<endl;
      |   ^~~~
      |   std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:75,
                 from /in/foo.cc:1:
/usr/include/c++/9/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
/in/foo.cc:20:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |   cout<<(flag?"Yes":"No")<<endl;
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/9/istream:39,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from /in/foo.cc:1:
/usr/include/c++/9/ostream:599:5: note: 'std::endl' declared here
  599 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~

信息

递交者
类型
自测
题目
P1062 找子串
语言
C++
递交时间
2025-03-29 08:42:03
评测时间
2025-03-29 08:42:03
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes