SHARE
TWEET

Untitled

a guest Jul 20th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main () {
  6. double a, b, c, x;
  7. cin >> a >> b >> c;
  8. if ((b*b - 4*a*c) >= 0) {
  9. x = ((-1)*b + sqrt(b*b - 4*a*c))/(2*a);
  10. cout << x << " ";
  11. x = ((-1)*b - sqrt(b*b - 4*a*c))/(2*a);
  12. cout << x << endl;
  13. } else {
  14. cout << x;
  15. }
  16. return 0;
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top