记录详情

Compile Error

foo.c:3:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sort'
 void selection sort(int array[],int length);
                ^~~~
foo.c: In function 'main':
foo.c:6:18: error: invalid initializer
  float score[30]=0;
                  ^
foo.c:10:12: error: 'num' undeclared (first use in this function)
  for(i=0;i<num;i++)
            ^~~
foo.c:10:12: note: each undeclared identifier is reported only once for each function it appears in
foo.c:12:12: warning: format '%lf' expects argument of type 'double *', but argument 2 has type 'float *' [-Wformat=]
   scanf("%lf",&score[i]);
          ~~^  ~~~~~~~~~
          %f
foo.c:7:8: warning: unused variable 'n' [-Wunused-variable]
  int i,n;
        ^
foo.c: At top level:
foo.c:16:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sort'
 void selection sort(int array[],int length)
                ^~~~
foo.c: In function 'main':
foo.c:12:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lf",&score[i]);
   ^~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1001 数组--排序
语言
C
递交时间
2021-11-07 16:16:42
评测时间
2021-11-07 16:16:42
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes