Advertisement
Guest User

Untitled

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