一元二次方程求根的程序 求指教
无警告 但是为什么无结果输出# include <stdio.h># include <math.h>
float root1 ( float a,float b,float c, float delta)
{ float term1,term2;
double x1,x2;
delta=b*b-4*a*c;
term1=-b/(2*a);
term2=sqrt(delta)/(2*a);
x1=term1+term2;
x2=term1-term2;
printf("%.2f,%.2f",x1,x2);}
float root2 (float a,float b,float c,float delta)
{ float term1,term2,x1,x2;
delta=b*b-4*a*c;
term1=-b/(2*a);
term2=sqrt(delta)/(2*a);
x1=term1+term2;
x2=term1-term2;
printf("%.2f,%.2f",x1);}
float root3(float a,float b,float c,float delta)
{ float term1,term2,x1,x2;
delta=b*b-4*a*c;
term1=-b/(2*a);
term2=sqrt(abs(delta))/(2*a);
x1=term1+term2;
x2=term1-term2;
printf("%.2f,%.2f",x1,x2);}
main()
{float a,b,c,delta;
printf("input a,b,c");
scanf("%.2f,%.2f,%.2f",&a,&b,&c);
delta=b*b-4*a*c;
if (a==0)
{if(b==0) printf("no root of this formular");
else printf("the single root is %.2f",-b/c);}
else if(delta>0){float root1(float a,float b, float c,float delta);}
else if(delta=0){ float root2 (float a,float b,float c,float delta);}
else{float root3 (float a,float b,float c,float delta);}}