改错:关于一元二次方程
#include<math.h>void main()
{
float a=0.0,float b=0.0,float c=0.0, float disc;
double x1=0.000000,x2=0.000000;
printf("input 3 numbers:");
scanf("%f%f%f",&a,&b,&c);
disc=b*b-4*a*c;
if(a==0.0)
if(b==0.0)
printf("no answer due to input error\n");
else printf("the single root is %f\n",-c/b);
else
{if(disc>=0.0)
{
if(disc>0.0)
x1=(-b+sqrt(disc))/(2*a);
x2=(-b-sqrt(disc))/(2*a);
printf("%f%f",x1,x2);
else
{x1=x2=-b/(2*a);
printf("%f%f",x1,x2);}
}
else
printf("无解");
}
不知道怎样改错,寻求帮助