记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:6:10: warning: format '%f' expects argument of type 'float *', but argument 2 has type 'double' [-Wformat=]
    6 |  scanf("%f""%f""%f",a,b,c);
      |         ~^          ~
      |          |          |
      |          float *    double
/in/foo.c:6:8: warning: format '%f' expects argument of type 'float *', but argument 3 has type 'double' [-Wformat=]
    6 |  scanf("%f""%f""%f",a,b,c);
      |        ^~~~           ~
      |                       |
      |                       double
/in/foo.c:6:14: note: format string is defined here
    6 |  scanf("%f""%f""%f",a,b,c);
      |             ~^
      |              |
      |              float *
/in/foo.c:6:8: warning: format '%f' expects argument of type 'float *', but argument 4 has type 'double' [-Wformat=]
    6 |  scanf("%f""%f""%f",a,b,c);
      |        ^~~~             ~
      |                         |
      |                         double
/in/foo.c:6:18: note: format string is defined here
    6 |  scanf("%f""%f""%f",a,b,c);
      |                 ~^
      |                  |
      |                  float *
/in/foo.c:7:5: warning: statement with no effect [-Wunused-value]
    7 |  n*n==b*b-4*a*c;
      |  ~~~^~~~~~~~~~~
/in/foo.c:9:2: error: 'x1' undeclared (first use in this function); did you mean 'x'?
    9 |  x1==(-b+n)2*a,x2==(-b-n)2*a;
      |  ^~
      |  x
/in/foo.c:9:2: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:9:12: error: expected ';' before numeric constant
    9 |  x1==(-b+n)2*a,x2==(-b-n)2*a;
      |            ^
      |            ;
/in/foo.c:10:22: error: 'x2' undeclared (first use in this function); did you mean 'x'?
   10 |  printf("%f","%f",x1,x2)
      |                      ^~
      |                      x
/in/foo.c:10:25: error: expected ';' before 'return'
   10 |  printf("%f","%f",x1,x2)
      |                         ^
      |                         ;
   11 |  return 0
      |  ~~~~~~                  
/in/foo.c:11:2: error: expected declaration or statement at end of input
   11 |  return 0
      |  ^~~~~~
/in/foo.c:5:8: warning: unused variable 'x' [-Wunused-variable]
    5 |  float x,a,b,c,n;
      |        ^

信息

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