alabala

Untitled

May 27th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a, b, c;
  9. double delta, x1, x2;
  10. cout << "introduceti coeficientii ec. de gr.2";
  11. cin >> a;
  12. cin >> b;
  13. cin >> c;
  14. delta = b * b - 4 * a * c;
  15. x1 = (-b + sqrt(delta))/(2 * a);
  16. x2 = (-b - sqrt(delta))/(2 * a);
  17. cout << x1 << " " << x2 << endl;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment