请教大佬
#include<stdio.h>#include<stdlib.h>
#include<math.h>
#define EPS 1e-6
int main (void)
{
float a,b,c,disc,p,q;
printf("please enter the coefficients a,b,c:");
scanf("%f,%f,%f",&a,&b,&c);
if (fabs(a)<=EPS); //a=0时,输出“不是二次方程”
{
printf("it si not a quadratic eqauation!\n");
exit(0);
}
disc=b*b-4*a*c; //
p=-b/(2*a) ;
q=sqrt(fabs(disc))/(2*a);
if(fabs(disc)<=EPS);
{
printf("x1=x2==%.2f\n",p);
}
else
{
if(disc>EPS)
{
printf("x1=%.2f,x2=%.2f\n",p+q,p-q);
}
else ;
{
printf("x1=%.2f+%.2fi",p,q);
printf("x1=%.2f%.2fi\n",p,q);
}
}
return 0;
}
他总是显示‘else’ without a previous ‘if’
24 | else ;
是哪里错了啊