Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a, b, c;
  7. cin >> a >> b >> c;
  8.  
  9. if ((a >= b + c) || (b >= a + c) || (c >= a + b)) {
  10. cout << "impossible";
  11. return 0;
  12. }
  13.  
  14. if ((c*c == a*a + b*b) || (a*a == b*b + c*c) || (b*b == a*a + c*c)) {
  15. cout << "right";
  16. return 0;
  17. }
  18.  
  19. if (c < a) swap(c, a);
  20. if (c < b) swap(c, b);
  21. if (b < a) swap(a, b);
  22.  
  23. if (c*c < a*a + b*b) {
  24. cout << "acute";
  25. return 0;
  26. } else {
  27. cout << "obtuse";
  28. return 0;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement