Advertisement
AlbertMourato

Untitled

Nov 27th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <iostream>
  3. using namespace std;
  4. int main(){
  5.     double a, b, c, delta, aux;
  6.     cin>>a;
  7.     cin>>b;
  8.     cin>>c;
  9.     if(a==0) cout<<"NEESG\n";
  10.     else{
  11.         delta = ((b*b)-(4*a*c));
  12.         if(delta<0){
  13.             cout<<"NRR\n";
  14.         }else{
  15.                 aux = ((-1*b)+ sqrt(delta))/(2*a);
  16.                 cout << setiosflags (ios::fixed) << setprecision (2)<< aux<<"\n";
  17.                 aux = ((-1*b)-sqrt(delta))/(2*a);
  18.                 cout << setiosflags (ios::fixed) << setprecision (2)<<aux <<"\n";
  19.         }
  20.     }
  21.     // cout << setiosflags (ios::fixed) << setprecision (2)<< <<"\n";
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement