#include "math.h"
float gen(float a,float b,float c)
{double x1,x2;
if(b*b-4*a*c>0)
{x1=-b+sqrt(b*b-4*a*c)/(2*a),
x2=-b-sqrt(b*b-4*a*c)/(2*a);
};
if(b*b-4*a*c==0)
{
x1=x2=-b/(2*a);
}
if(b*b-4*a*c<0)
printf("此方程无根\n");
if(b*b-4*a*c>=0)
printf("%f,%f",x1,x2);
};
void main()
{
float a,b,c;
scanf("%f,%f,%f",&a,&b,&c);
gen(a,b,c);
}
错误有2个
'printf' :undeclared identifier
'scanf' : undeclared identifier 谢谢