求解 为什么运行结果不对啊??
#include<stdio.h>#include<math.h>
int main()
{
void big(float a,float b,float c);
void equality(float a,float b,float c);
void small(float a,float b,float c);
float a,b,c,d;
printf("请输入三个数:");
scanf("%f,%f,%f",&a,&b,&c);
d=b*b-4*a*c;
if(d>0) big(a,b,c);
if(d==0) equality(a,b,c);
if(d<0) small(a,b,c);
}
void big(float a,float b,float c)
{
float x1,x2;
x1=(-b+sqrt(b*b-4*a*c))/(2*a);
x2=(-b-sqrt(b*b-4*a*c))/(2*a);
printf("方程的根:%6.2f或%6.2f\n",x1,x2);
}
void equality(float a,float b,float c)
{
float x;
x=-b/(2*a);
printf("方程的根:%6.2f\n",x);
}
void small(float a,float b,float c)
{
printf("无解\n");
}