记录详情

Compile Error

/in/foo.c: In function 'maximum':
/in/foo.c:5:13: error: 'max' redeclared as different kind of symbol
  float a[9],max,mim,temp,i,j;
             ^~~
/in/foo.c:3:20: note: previous definition of 'max' was here
 void maximum(float max,float mim)
                    ^~~
/in/foo.c:5:17: error: 'mim' redeclared as different kind of symbol
  float a[9],max,mim,temp,i,j;
                 ^~~
/in/foo.c:3:30: note: previous definition of 'mim' was here
 void maximum(float max,float mim)
                              ^~~
/in/foo.c:11:9: error: array subscript is not an integer
     if(a[j]>max)
         ^
/in/foo.c:16:11: error: array subscript is not an integer
      max=a[i];
           ^
/in/foo.c:17:7: error: array subscript is not an integer
      a[i]=temp;
       ^
/in/foo.c:19:5: error: 'min' undeclared (first use in this function)
     min=9;
     ^~~
/in/foo.c:19:5: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:5:17: warning: unused variable 'mim' [-Wunused-variable]
  float a[9],max,mim,temp,i,j;
                 ^~~
/in/foo.c: In function 'average':
/in/foo.c:29:12: error: array subscript is not an integer
   sum=sum+a[i];
            ^
/in/foo.c:26:8: warning: variable 'ave' set but not used [-Wunused-but-set-variable]
  float ave;
        ^~~
/in/foo.c:25:8: warning: variable 'a' set but not used [-Wunused-but-set-variable]
  float a[9],i,sum=0;
        ^
/in/foo.c: In function 'main':
/in/foo.c:37:2: error: 'max1' undeclared (first use in this function)
  max1=maximum;
  ^~~~
/in/foo.c:38:2: error: 'mim1' undeclared (first use in this function)
  mim1=maximum;
  ^~~~
/in/foo.c:39:2: error: 'ave1' undeclared (first use in this function)
  ave1=average;
  ^~~~
/in/foo.c:40:36: error: 'ave' undeclared (first use in this function)
  printf("%.2f,%.2f,%.2f",max1,mim1,ave);
                                    ^~~

信息

递交者
类型
自测
语言
C
递交时间
2024-12-06 17:27:34
评测时间
2024-12-06 17:27:34
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes