Compile Error

foo.cc: In function 'int main()':
foo.cc:8:6: error: conflicting declaration 'int a [1]'
    8 |  int a[1]=x,a[2]=y;
      |      ^
foo.cc:7:6: note: previous declaration as 'int a [(z + 100)]'
    7 |  int a[z+100];
      |      ^
foo.cc:8:13: error: conflicting declaration 'int a [2]'
    8 |  int a[1]=x,a[2]=y;
      |             ^
foo.cc:7:6: note: previous declaration as 'int a [(z + 100)]'
    7 |  int a[z+100];
      |      ^
foo.cc:9:10: error: expected unqualified-id before numeric constant
    9 |  for(int 1=3;i<=z;i++)
      |          ^
foo.cc:9:9: error: expected ';' before numeric constant
    9 |  for(int 1=3;i<=z;i++)
      |         ^~
      |         ;
foo.cc:9:12: error: lvalue required as left operand of assignment
    9 |  for(int 1=3;i<=z;i++)
      |            ^
foo.cc:9:14: error: 'i' was not declared in this scope
    9 |  for(int 1=3;i<=z;i++)
      |              ^
foo.cc:9:18: error: expected ')' before ';' token
    9 |  for(int 1=3;i<=z;i++)
      |     ~            ^
      |                  )
foo.cc:9:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    9 |  for(int 1=3;i<=z;i++)
      |  ^~~
foo.cc:9:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    9 |  for(int 1=3;i<=z;i++)
      |                   ^
foo.cc:9:19: error: 'i' was not declared in this scope
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P2327 1.3.18:等差数列末项计算
语言
C++
递交时间
2022-06-08 21:28:31
评测时间
2022-06-08 21:28:31
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes