#include<stdio.h> #include<math.h> int main () { double a,b,c; double x1,x2,su; scanf("%lf %lf %lf",&a,&b,&c); su=b*b-4*a*c; x1=(sqrt(su)-b)/(2*a); x2=(-sqrt(su)-b)/2/a; printf("%.2lf %.2lf",x1,x2); }
Double click to view unformatted code.