记录详情

Compile Error

/in/foo.c: In function 'solveEquation':
/in/foo.c:17:47: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   17 |                                 double x1=(-b+sqrt(delta))/(2*a);
      |                                               ^~~~
/in/foo.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
/in/foo.c:17:47: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   17 |                                 double x1=(-b+sqrt(delta))/(2*a);
      |                                               ^~~~
/in/foo.c:17:47: note: include '<math.h>' or provide a declaration of 'sqrt'
/in/foo.c:22:42: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   22 |                                 imagPart=sqrt(-delta)/(2*a);
      |                                          ^~~~
/in/foo.c:22:42: note: include '<math.h>' or provide a declaration of 'sqrt'
/in/foo.c: At top level:
/in/foo.c:28:5: error: redefinition of 'main'
   28 | int main(){
      |     ^~~~
/in/foo.c:3:5: note: previous definition of 'main' with type 'int()'
    3 | int main()
      |     ^~~~
/in/foo.c: In function 'main':
/in/foo.c:29:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   29 |         double a,b,c:
      |                     ^
/in/foo.c:31:9: warning: implicit declaration of function 'solveEquation' [-Wimplicit-function-declaration]
   31 |         solveEquation(a,b,c);
      |         ^~~~~~~~~~~~~
/in/foo.c:31:27: error: 'c' undeclared (first use in this function)
   31 |         solveEquation(a,b,c);
      |                           ^
/in/foo.c:31:27: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c: At top level:
/in/foo.c:5:14: warning: 'solveEquation' defined but not used [-Wunused-function]
    5 |         void solveEquation(double a,double b,double c){
      |              ^~~~~~~~~~~~~

信息

递交者
类型
自测
语言
C
递交时间
2025-12-23 17:13:55
评测时间
2025-12-23 17:13:55
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes