记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:5:18: warning: format '%f' expects argument of type 'float *', but argument 2 has type 'double *' [-Wformat=]
    5 |         scanf("%1f,%1f,%1f",&a,&b,&c);
      |                ~~^          ~~
      |                  |          |
      |                  float *    double *
      |                %1lf
/in/foo.c:5:22: warning: format '%f' expects argument of type 'float *', but argument 3 has type 'double *' [-Wformat=]
    5 |         scanf("%1f,%1f,%1f",&a,&b,&c);
      |                    ~~^         ~~
      |                      |         |
      |                      float *   double *
      |                    %1lf
/in/foo.c:5:26: warning: format '%f' expects argument of type 'float *', but argument 4 has type 'double *' [-Wformat=]
    5 |         scanf("%1f,%1f,%1f",&a,&b,&c);
      |                        ~~^        ~~
      |                          |        |
      |                          float *  double *
      |                        %1lf
/in/foo.c:12:32: warning: implicit declaration of function 'power' [-Wimplicit-function-declaration]
   12 |                         x1=(-b+power(delta,0.5))/(2*a);
      |                                ^~~~~
/in/foo.c:14:36: warning: format '%f' expects argument of type 'double', but argument 2 has type 'char *' [-Wformat=]
   14 |                         printf("%.2f\n","%.2f\n",x1,x2);}
      |                                 ~~~^    ~~~~~~~~
      |                                    |    |
      |                                    |    char *
      |                                    double
      |                                 %.2s
/in/foo.c:14:32: warning: too many arguments for format [-Wformat-extra-args]
   14 |                         printf("%.2f\n","%.2f\n",x1,x2);}
      |                                ^~~~~~~~
/in/foo.c:18:60: error: expected ';' before '}' token
   18 |                                         printf("%.2f\n",x1)}
      |                                                            ^
      |                                                            ;
/in/foo.c:21:44: error: expected ';' before '}' token
   21 |                         printf("%.2f\n",x2)}
      |                                            ^
      |                                            ;
/in/foo.c: At top level:
/in/foo.c:24:17: error: expected identifier or '(' before 'return'
   24 |                 return 0;
      |                 ^~~~~~
/in/foo.c:25:1: error: expected identifier or '(' before '}' token
   25 | }
      | ^

信息

递交者
类型
自测
语言
C
递交时间
2025-12-24 10:54:03
评测时间
2025-12-24 10:54:03
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes