fork download
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. double a,b,c,s,x1,x2;
  6. scanf("%lf %lf %lf",&a,&b,&c);
  7. x1=(-b+sqrt(b*b-4*a*c)/(2*a));
  8. x2=(-b-sqrt(b*b-4*a*c)/(2*a));
  9. printf("%lf\n",x1,x2);
  10. return 0;
  11. }
Success #stdin #stdout 0.01s 5548KB
stdin
2
stdout
-nan