Guest User

Untitled

a guest
Jul 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.  float a,b,c,delta,x1,x2;
  7. scanf("%f %f %f", &a, &b, &c);
  8. if(a == 0)
  9.     {
  10.     printf("NEESG\n");
  11.     return 0;
  12.     }
  13.     delta = (b*b)-(4*a*c);
  14. if(delta<0)
  15.     {
  16.     printf("RNE\n");
  17.     }
  18. else
  19.     {
  20.     x1 = (0-b+ sqrt(delta))/(2*a);
  21.     x2 = (0-b- sqrt(delta))/(2*a);
  22.     printf("%2.f %2.f\n", x1, x2);
  23.    
  24.     }
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment