#include<stdio.h>
#include<math.h>
int main()
{
double a,b,c,x1,x2,d;
scanf("%lf %lf %lf",&a,&b,&c);
a*x^2+b*x+c=0;
d=sqrt(b^2-8*a*c);
if(b^2-8*a*c > 0)
{
printf("%.2lf,%.2lf",x1=(-b+d)/4/a,x2=(-b-d)/4/a);
}
else if(b^2-8*a*c = 0)
{
printf("%.2lf",x1=-b/a/4);
}
else
{
printf("no");
}
return 0;
}
一元二次方程求解
习惯受伤
相关分类