记录详情

Compile Error

/in/foo.c: In function 'zuidazhi':
/in/foo.c:27:9: error: 'max' undeclared (first use in this function)
         max=a[0];
         ^~~
/in/foo.c:27:9: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:31:29: warning: passing argument 1 of 'zuidazhi' makes pointer from integer without a cast [-Wint-conversion]
        max=(a[n-1]>zuidazhi(n-1)?a[n-1]:zuidazhi(n-1));
                             ^
/in/foo.c:22:5: note: expected 'int *' but argument is of type 'int'
 int zuidazhi(int a[],int n)
     ^~~~~~~~
/in/foo.c:31:20: error: too few arguments to function 'zuidazhi'
        max=(a[n-1]>zuidazhi(n-1)?a[n-1]:zuidazhi(n-1));
                    ^~~~~~~~
/in/foo.c:22:5: note: declared here
 int zuidazhi(int a[],int n)
     ^~~~~~~~
/in/foo.c:31:50: warning: passing argument 1 of 'zuidazhi' makes pointer from integer without a cast [-Wint-conversion]
        max=(a[n-1]>zuidazhi(n-1)?a[n-1]:zuidazhi(n-1));
                                                  ^
/in/foo.c:22:5: note: expected 'int *' but argument is of type 'int'
 int zuidazhi(int a[],int n)
     ^~~~~~~~
/in/foo.c:31:41: error: too few arguments to function 'zuidazhi'
        max=(a[n-1]>zuidazhi(n-1)?a[n-1]:zuidazhi(n-1));
                                         ^~~~~~~~
/in/foo.c:22:5: note: declared here
 int zuidazhi(int a[],int n)
     ^~~~~~~~
/in/foo.c:34:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
自测
题目
P1019 递归Max
语言
C
递交时间
2021-11-17 10:48:02
评测时间
2021-11-17 10:48:02
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes