记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:9:28: warning: passing argument 2 of 'sscanf' from incompatible pointer type [-Wincompatible-pointer-types]
  sscanf("%input %lf%lf%lf",&a,&b,&c);
                            ^
In file included from /usr/include/features.h:364:0,
                 from /usr/include/stdio.h:27,
                 from /in/foo.c:1:
/usr/include/stdio.h:450:12: note: expected 'const char * restrict' but argument is of type 'double *'
 extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s,
            ^
/in/foo.c:12:18: error: 'discrimnat' undeclared (first use in this function)
   root1=(-b+sqrt(discrimnat))/(2*a);
                  ^~~~~~~~~~
/in/foo.c:12:18: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:14:14: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   printf("%.2f\n,root1");
              ^
/in/foo.c:15:14: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   printf("%.2f\n,root2");
              ^
/in/foo.c:17:10: error: 'discrimant' undeclared (first use in this function)
  else if(discrimant==0)
          ^~~~~~~~~~
/in/foo.c:23:2: error: expected '(' before '{' token
  {
  ^
/in/foo.c:25:23: error: 'discriminat' undeclared (first use in this function)
   imaginarypart=sqrt(-discriminat)/(2*a);
                       ^~~~~~~~~~~
/in/foo.c:6:22: warning: variable 'root1' set but not used [-Wunused-but-set-variable]
  double discriminant,root1,root2,realpart,imaginarypart;
                      ^~~~~

信息

递交者
类型
递交
比赛
2024级9点半
语言
C
递交时间
2024-12-24 09:46:44
评测时间
2024-12-24 09:46:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes