求解答,我这个程序怎么不对啊?
#include <stdio.h>#include <math.h>
int main()
{
double a,b,c,disc,x1,x2;
scanf("%1f,%1f,%1f",&a,&b,&c);
disc=b*b-4*a*c;
if(fabs(disc)<=1e-6)
printf("有两个相等的实根:%8.4f\n",-b/(2*a));
else if(disc>0)
{ x1=(-b+sqrt(disc))/(2*a);
x2=(-b-sqrt(disc))/(2*a);
printf("该方程有两个相同的实根:%8.4f and %8.4f\n",x1,x2);
}
else
{
printf("该方程没有实根。\n");
}
getchar();
return 0;
}