记录详情

Compile Error

foo.c: In function 'main':
foo.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
    5 |         int arr a[];
      |                 ^
foo.c:5:17: error: 'a' undeclared (first use in this function)
foo.c:5:17: note: each undeclared identifier is reported only once for each function it appears in
foo.c:5:19: error: expected expression before ']' token
    5 |         int arr a[];
      |                   ^
foo.c:6:23: error: 'n' undeclared (first use in this function)
    6 |         for(int i=0;i<n;i++)
      |                       ^
foo.c:7:28: error: expected ')' before '\U0000ff0ca'
    7 |                 printf("%d",a[i]);
      |                       ~    ^~~
      |                            )
foo.c:7:26: warning: format '%d' expects a matching 'int' argument [-Wformat=]
    7 |                 printf("%d",a[i]);
      |                         ~^
      |                          |
      |                          int
foo.c:6:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    6 |         for(int i=0;i<n;i++)
      |         ^~~
foo.c:8:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    8 |                 printf("\n");
      |                 ^~~~~~
foo.c: In function 'FindMin':
foo.c:16:9: error: 'min\U0000ff09' undeclared (first use in this function)
   16 | if(a[i]<min)
      |         ^~~~~
foo.c:16:14: error: expected ')' before '{' token
   16 | if(a[i]<min)
      |   ~          ^
      |              )
   17 |    {
      |    ~          
foo.c:21:4: error: expected expression before '}' token
   21 |    }
      |    ^
foo.c: At top level:
foo.c:24:8: warning: second argument of 'main' should be 'char **' [-Wmain]
   24 |    int main(int argc,char*argv)
      |        ^~~~
foo.c:24:8: error: redefinition of 'main'
foo.c:3:5: note: previous definition of 'main' with type 'int()'
    3 | int main()
      |     ^~~~
foo.c: In function 'main':
foo.c:27:19: error: 'i' undeclared (first use in this function)
   27 |             int a[i];
      |                   ^
foo.c:28:31: error: 'na' undeclared (first use in this function); did you mean 'a'?
   28 |            int amin=FindMin(a,na);
      |                               ^~
      |                               a
foo.c:29:26: error: 'min' undeclared (first use in this function); did you mean 'amin'?
   29 |            printf("%d\n",min)
      |                          ^~~
      |                          amin
foo.c:29:30: error: expected ';' before 'return'
   29 |            printf("%d\n",min)
      |                              ^
      |                              ;
   30 |                    return 0;
      |                    ~~~~~~     
foo.c:30:27: error: invalid suffix ";" on integer constant
   30 |                    return 0;
      |                           ^~~
foo.c:28:16: warning: unused variable 'amin' [-Wunused-variable]
   28 |            int amin=FindMin(a,na);
      |                ^~~~
foo.c:27:17: warning: unused variable 'a' [-Wunused-variable]
   27 |             int a[i];
      |                 ^
foo.c:26:16: warning: unused variable 'n' [-Wunused-variable]
   26 |            int n;
      |                ^
foo.c: At top level:
foo.c:32:4: error: expected identifier or '(' before '}' token
   32 |    }
      |    ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A7-2 数组的极值函数
比赛
2023 程序设计与基础(单个的数组)
语言
C
递交时间
2023-11-21 14:17:45
评测时间
2023-11-21 14:17:45
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes