Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:19:25: error: expected primary-expression before 'if'
   19 |                         if(c[i]==1)sum++;1;i--)
      |                         ^~
/in/foo.cc:18:32: error: expected ';' before 'if'
   18 |                 for(int i=d;i>=
      |                                ^
      |                                ;
   19 |                         if(c[i]==1)sum++;1;i--)
      |                         ~~      
/in/foo.cc:19:25: error: expected primary-expression before 'if'
   19 |                         if(c[i]==1)sum++;1;i--)
      |                         ^~
/in/foo.cc:18:32: error: expected ')' before 'if'
   18 |                 for(int i=d;i>=
      |                    ~           ^
      |                                )
   19 |                         if(c[i]==1)sum++;1;i--)
      |                         ~~      
/in/foo.cc:19:25: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   19 |                         if(c[i]==1)sum++;1;i--)
      |                         ^~
/in/foo.cc:19:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   19 |                         if(c[i]==1)sum++;1;i--)
      |                                          ^
/in/foo.cc:18:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   18 |                 for(int i=d;i>=
      |                 ^~~
/in/foo.cc:19:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   19 |                         if(c[i]==1)sum++;1;i--)
      |                                          ^
/in/foo.cc:19:42: warning: statement has no effect [-Wunused-value]
/in/foo.cc:19:44: error: 'i' was not declared in this scope
   19 |                         if(c[i]==1)sum++;1;i--)
      |                                            ^

信息

递交者
类型
递交
题目
P2949 奇偶校验
语言
C++
递交时间
2026-02-24 18:04:59
评测时间
2026-02-24 18:04:59
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes