Compile Error

foo.cc: In function 'int main()':
foo.cc:8:6: error: conflicting declaration 'int max [1001]'
    8 |  int max[1001]={-1};
      |      ^~~
foo.cc:5:11: note: previous declaration as 'int max'
    5 |  int n,x1,max;
      |           ^~~
foo.cc:9:11: warning: right operand of comma operator has no effect [-Wunused-value]
    9 |  cin>>n,x1;
      |           ^
foo.cc:11:6: error: 'i' was not declared in this scope
   11 |  for(i=2;i<=n;i++)
      |      ^
foo.cc:16:6: error: 'i' was not declared in this scope
   16 |  for(i=1;i<=n;i++)
      |      ^
foo.cc:20:6: error: 'i' was not declared in this scope
   20 |  for(i=1;i<=n;i++)
      |      ^
foo.cc:25:3: error: 'flag' was not declared in this scope
   25 |   flag=i;
      |   ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1062 夏令营小旗手
语言
C++
递交时间
2022-05-09 15:57:29
评测时间
2022-05-09 15:57:29
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes