Compile Error

foo.cc: In function 'int main()':
foo.cc:6:14: error: expected unqualified-id before numeric constant
    6 |      for(int 1=1;1<=100;1++)
      |              ^
foo.cc:6:13: error: expected ';' before numeric constant
    6 |      for(int 1=1;1<=100;1++)
      |             ^~
      |             ;
foo.cc:6:16: error: lvalue required as left operand of assignment
    6 |      for(int 1=1;1<=100;1++)
      |                ^
foo.cc:6:19: warning: for increment expression has no effect [-Wunused-value]
    6 |      for(int 1=1;1<=100;1++)
      |                  ~^~~~~
foo.cc:6:24: error: expected ')' before ';' token
    6 |      for(int 1=1;1<=100;1++)
      |         ~              ^
      |                        )
foo.cc:6:6: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    6 |      for(int 1=1;1<=100;1++)
      |      ^~~
foo.cc:6:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    6 |      for(int 1=1;1<=100;1++)
      |                         ^
foo.cc:6:26: error: lvalue required as increment operand
    6 |      for(int 1=1;1<=100;1++)
      |                          ^~
foo.cc:5:16: warning: unused variable 't' [-Wunused-variable]
    5 |      int sum=0,t=1;
      |                ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1040 计算1-2+3-4+5-6+...+99-100
语言
C++
递交时间
2021-12-11 09:06:17
评测时间
2021-12-11 09:06:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes