#include <stdio.h>
#include <math.h>
int main(){
float a,b,c,n1,n2;
float res1,res2;
scanf("%f%f%f",&a,&b,&c);
if(b*b-4*a*c>0)
{
res1 = (-b+sqrt(b*b-4*a*c))/(2*a);
res2 = (-b-sqrt(b*b-4*a*c))/(2*a);
if(res1>res2)
{
printf("%.2f %.2f",res1,res2);
}
else
printf("%.2f %.2f",res2,res1);
}
else if(b*b-4*a*c==0)
{
res1 = (-b)/(2*a);
res2 = (-b)/(2*a);
printf("%.2f %.2f",res1,res2);
}
else
{
res1 = -b/(2*a);
res2 = -b/(2*a);
n1 = (sqrt(-b*b+4*a*c))/(2*a);
n2 = -(sqrt(-b*b+4*a*c))/(2*a);
printf("%.2f%+.2fi %.2f%+.2fi",res1,n1,res2,n2);
}
return 0;
}
最后发现竟然疏忽了计算先后问题……