#include<stdio.h> #include<stdio.h> int main(){ int a,b,c,d,c1,c2; scanf("%d %d %d",&a,&b,&c); d=b*b-4*a*c; if(d>0){ c1=-b+sqrt(d)/4*a; c1=-b-sqrt(d)/4*a; if(c1>c2) printf("%.2lf %.2lf",c1,c2); else printf("%.2lf %.2lf",c2,c1); } else{ printf("ERROR"); } return 0; } |
Double click to view unformatted code.