Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:6:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(i=1;i<=n;i++)
  ^~~
/in/foo.cc:8:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
   while(a[i]>0)
   ^~~~~
/in/foo.cc: At global scope:
/in/foo.cc:15:6: error: expected constructor, destructor, or type conversion before '(' token
  sort(a+1,a+n+1);
      ^
/in/foo.cc:16:2: error: expected unqualified-id before 'for'
  for(int i=1;i<=n;i++)
  ^~~
/in/foo.cc:16:14: error: 'i' does not name a type
  for(int i=1;i<=n;i++)
              ^
/in/foo.cc:16:19: error: 'i' does not name a type
  for(int i=1;i<=n;i++)
                   ^
/in/foo.cc:18:2: error: expected unqualified-id before 'return'
  return 0;
  ^~~~~~
/in/foo.cc:19:1: error: expected declaration before '}' token
 }
 ^

信息

递交者
类型
递交
题目
P1884 数的排序
比赛
初二国庆庆祝赛
语言
C++
递交时间
2021-10-01 19:33:58
评测时间
2021-10-01 19:33:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes