Compile Error

/in/foo.cc:3:9: error: size of array 'a' is not an integral constant-expression
    3 | int n,a[n],b[n],w;
      |         ^
/in/foo.cc:3:14: error: size of array 'b' is not an integral constant-expression
    3 | int n,a[n],b[n],w;
      |              ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:11:24: error: 'lower' was not declared in this scope; did you mean 'tolower'?
   11 |         sort(a[1],a[n],lower<int>()}
      |                        ^~~~~
      |                        tolower
/in/foo.cc:11:30: error: expected primary-expression before 'int'
   11 |         sort(a[1],a[n],lower<int>()}
      |                              ^~~
/in/foo.cc: At global scope:
/in/foo.cc:12:9: error: expected unqualified-id before 'for'
   12 |         for(int i=1;i<=n;i++)
      |         ^~~
/in/foo.cc:12:21: error: 'i' does not name a type
   12 |         for(int i=1;i<=n;i++)
      |                     ^
/in/foo.cc:12:26: error: 'i' does not name a type
   12 |         for(int i=1;i<=n;i++)
      |                          ^
/in/foo.cc:16:13: error: expected constructor, destructor, or type conversion before '(' token
   16 |         sort(b[1],b[n],lower<int>()}
      |             ^
/in/foo.cc:16:36: error: expected declaration before '}' token
   16 |         sort(b[1],b[n],lower<int>()}
      |                                    ^
/in/foo.cc:17:9: error: expected unqualified-id before 'for'
   17 |         for(int j=1;j<=n;j++)
      |         ^~~
/in/foo.cc:17:21: error: 'j' does not name a type
   17 |         for(int j=1;j<=n;j++)
      |                     ^
/in/foo.cc:17:26: error: 'j' does not name a type
   17 |         for(int j=1;j<=n;j++)
      |                          ^
/in/foo.cc:27:9: error: 'cout' does not name a type
   27 |         cout<<200*w;
      |         ^~~~
/in/foo.cc:28:9: error: expected unqualified-id before 'return'
   28 |         return 0;
      |         ^~~~~~
/in/foo.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^

信息

递交者
类型
自测
题目
P2469 新田忌赛马
语言
C++
递交时间
2025-06-07 10:43:44
评测时间
2025-06-07 10:43:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes