记录详情

Compile Error

foo.c: In function 'main':
foo.c:8:12: error: expected expression before 'double'
   distance(double a[m][4],int m);
            ^~~~~~
foo.c:8:3: error: too few arguments to function 'distance'
   distance(double a[m][4],int m);
   ^~~~~~~~
foo.c:5:8: note: declared here
   void distance(double a[][4],int m);
        ^~~~~~~~
foo.c: In function 'distance':
foo.c:18:13: warning: format '%f' expects argument of type 'float *', but argument 2 has type 'double *' [-Wformat=]
     scanf("%f %f %f %f",&a[i][0],&a[i][1],&a[i][2],&a[i][3]);
            ~^           ~~~~~~~~
            %lf
foo.c:18:16: warning: format '%f' expects argument of type 'float *', but argument 3 has type 'double *' [-Wformat=]
     scanf("%f %f %f %f",&a[i][0],&a[i][1],&a[i][2],&a[i][3]);
               ~^                 ~~~~~~~~
               %lf
foo.c:18:19: warning: format '%f' expects argument of type 'float *', but argument 4 has type 'double *' [-Wformat=]
     scanf("%f %f %f %f",&a[i][0],&a[i][1],&a[i][2],&a[i][3]);
                  ~^                       ~~~~~~~~
                  %lf
foo.c:18:22: warning: format '%f' expects argument of type 'float *', but argument 5 has type 'double *' [-Wformat=]
     scanf("%f %f %f %f",&a[i][0],&a[i][1],&a[i][2],&a[i][3]);
                     ~^                             ~~~~~~~~
                     %lf
foo.c:20:10: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
     b[i]=sqrt(b[i]);
          ^~~~
foo.c:20:10: warning: incompatible implicit declaration of built-in function 'sqrt'
foo.c:20:10: note: include '<math.h>' or provide a declaration of 'sqrt'
foo.c: In function 'main':
foo.c:7:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&m);
   ^~~~~~~~~~~~~~
foo.c: In function 'distance':
foo.c:18:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%f %f %f %f",&a[i][0],&a[i][1],&a[i][2],&a[i][3]);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1017 距离函数
语言
C
递交时间
2021-11-16 16:09:58
评测时间
2021-11-16 16:09:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes