记录详情

Compile Error

foo.c:2:18: error: 's' undeclared here (not in a function)
    2 | int findmax(int [s],int t,int k)
      |                  ^
foo.c: In function 'findmax':
foo.c:2:13: error: parameter name omitted
    2 | int findmax(int [s],int t,int k)
      |             ^~~~~~~
foo.c:8:6: error: 's' undeclared (first use in this function)
    8 |   if(s[k]<s[i])
      |      ^
foo.c:8:6: note: each undeclared identifier is reported only once for each function it appears in
foo.c: In function 'main':
foo.c:13:5: warning: type of 'findmax' defaults to 'int' [-Wimplicit-int]
   13 | int main(findmax)
      |     ^~~~
foo.c:15:8: error: 'n' undeclared (first use in this function)
   15 |  int a[n]={},k;
      |        ^
foo.c:15:11: error: empty scalar initializer
   15 |  int a[n]={},k;
      |           ^
foo.c:15:11: note: (near initialization for 'a')
foo.c:16:15: error: 'K' undeclared (first use in this function)
   16 |  findmax(a,n,&K);
      |               ^
foo.c:16:2: error: called object 'findmax' is not a function or function pointer
   16 |  findmax(a,n,&K);
      |  ^~~~~~~
foo.c:13:5: note: declared here
   13 | int main(findmax)
      |     ^~~~
foo.c:15:6: warning: unused variable 'a' [-Wunused-variable]
   15 |  int a[n]={},k;
      |      ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A7-3 数组的极值下标函数
语言
C
递交时间
2021-12-21 19:57:56
评测时间
2021-12-21 19:57:56
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes