C语言高手帮忙呀一元二次方程
#include <stdio.h>#include <math.h>
void main()
{
float a,b,c,disc,x1,x2,r,p;
scanf("%f,%f,%f",&a,&b,&c);
if(a==0)
if(b==0)
printf("Input error!\n");
else printf("x=%f\n",-c/b);
else{ disc=b*b-4*a*c;
if(disc==0)
printf("x1=x2=%f\n",-b/(2*a));
else if(disc>0)
{x1=(-b+sqrt(disc))/(2*a);
x2=(-b-sqrt(disc))/(2*a);
printf("x1=%f\nx2=%f\n",x1,x2);}
else
{r=-b/(2*a);
p=sqrt(-disc)/(2*a);
printf("x1=%f+%fi\n",r,p);
printf("x2=%f-%fi\n",r,p);}}}
哪里错了???救救我吧