/ OPS /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:9:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   for(int i=0;i<str1.size();i++){
      |               ~^~~~~~~~~~~~
/in/foo.cc:11:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int j=0;i<str2.size();j++){
      |                 ~^~~~~~~~~~~~
/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:12:27: error: expected ';' before '{' token
   12 |      if(str1[i+j]!=str2[j] {
      |                           ^~
      |                           ;
/in/foo.cc:12:18: warning: value computed is not used [-Wunused-value]
   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;
      |         ~~~~^~~~~

信息

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