#include <stdio.h>
#include <math.h>
int main() {
double a,b,c;
printf("enter a,b and c:");
scanf("%lf,%lf,%lf",&a,&b,&c);
if (a==0&&b==0&&c==0){
printf("方程不存在");
}
else if(a==0&&b!=0){
double x=-c/b;
printf("方程的解为%.3lf,%.3lf",x,x);
}
else {
double delta=b*b-4*a*c;
double x1,x2;
if (delta==0){
x1=x2=-b/2*a;
printf("方程的解是%.3lf,%.3lf",x1,x2);
}else if (delta>0){
x1=(-b+sqrt(delta))/(2*a);
x2=(-b-sqrt(delta))/(2*a);
if (x1>x2){
printf("方程的根为%.3lf,%.3lf",x2,x1);
}
else
printf("方程的根是%.3lf,%.3lf",x1,x2);
}else {
printf("方程无解");
}
}
return 0;
}