记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:5:17: error: conflicting declaration 'int a [1000]'
   int a,i,a[1000];
                 ^
foo.cc:5:7: note: previous declaration as 'int a'
   int a,i,a[1000];
       ^
foo.cc:7:19: error: 'm' was not declared in this scope
   for (i = 0; i < m; i++)
                   ^
foo.cc:9:14: error: invalid types 'int[int]' for array subscript
    cin >> a[i];
              ^
foo.cc:12:19: error: 'm' was not declared in this scope
   for (i = 1; i < m-1; i++)
                   ^
foo.cc:14:12: error: invalid types 'int[int]' for array subscript
     if (a[i] >= a[i - 1] && a[i] >= a[i + 1])
            ^
foo.cc:14:24: error: invalid types 'int[int]' for array subscript
     if (a[i] >= a[i - 1] && a[i] >= a[i + 1])
                        ^
foo.cc:14:32: error: invalid types 'int[int]' for array subscript
     if (a[i] >= a[i - 1] && a[i] >= a[i + 1])
                                ^
foo.cc:14:44: error: invalid types 'int[int]' for array subscript
     if (a[i] >= a[i - 1] && a[i] >= a[i + 1])
                                            ^
foo.cc:19:10: error: invalid types 'int[int]' for array subscript
   if (a[0] >= a[1] && a[0]>=a[m-1])
          ^
foo.cc:19:18: error: invalid types 'int[int]' for array subscript
   if (a[0] >= a[1] && a[0]>=a[m-1])
                  ^
foo.cc:19:26: error: invalid types 'int[int]' for array subscript
   if (a[0] >= a[1] && a[0]>=a[m-1])
                          ^
foo.cc:19:31: error: 'm' was not declared in this scope
   if (a[0] >= a[1] && a[0]>=a[m-1])
                               ^
foo.cc:21:9: error: 'm' was not declared in this scope
   if (a[m-1]>=a[m-2] && a[m-1]>=a[0])
         ^
foo.cc:21:36: error: invalid types 'int[int]' for array subscript
   if (a[m-1]>=a[m-2] && a[m-1]>=a[0])
                                    ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1033 环形山丘
语言
C++
递交时间
2021-09-24 21:44:45
评测时间
2021-09-24 21:44:45
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes