Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:7:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    7 |         for(;i=1;i<=n;i+=2)
      |              ~^~
/in/foo.cc:7:19: warning: for increment expression has no effect [-Wunused-value]
    7 |         for(;i=1;i<=n;i+=2)
      |                  ~^~~
/in/foo.cc:7:22: error: expected ')' before ';' token
    7 |         for(;i=1;i<=n;i+=2)
      |            ~         ^
      |                      )
/in/foo.cc:7:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    7 |         for(;i=1;i<=n;i+=2)
      |         ^~~
/in/foo.cc:7:23: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    7 |         for(;i=1;i<=n;i+=2)
      |                       ^
/in/foo.cc:7:27: error: expected ';' before ')' token
    7 |         for(;i=1;i<=n;i+=2)
      |                           ^
      |                           ;

信息

递交者
类型
递交
题目
P1104 G7-1 统计不及格人数
语言
C++
递交时间
2025-03-20 20:24:30
评测时间
2025-03-20 20:24:30
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes