加个主函数!!!高手来
void solv_quadr_equa (float a,float b,float c){
if(a==0)
if(b==0)
printf("no answer due to input error\n");
else
printf("the single root is %f\n",-c/b);
else
{double disc,twoa,term1,term2;
disc=b*b-4*a*c;
twoa=2*a;
term1=-b/twoa;
term2=sqrt (fabs (disc)/twoa;
if(disc<0.0)
printf("complex root:\n real part=%f,imag part=%f\n",term1,term2);
else
printf("real root:\n root1=%f,root2=%f\n",term1+term2,term1-term2);
}