fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. typedef long long ll;
  6.  
  7. int x[3], y[3];
  8.  
  9. ll l(ll x1, ll y1, ll x2, ll y2)
  10. {
  11. return (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
  12. }
  13.  
  14. void solve()
  15. {
  16. long long side[3];
  17. for(int i = 0; i < 3; i++)
  18. side[i] = l(x[i], y[i], x[(i+1)%3], y[(i+1)%3]);
  19. for(int i = 0; i < 3; i++)
  20. {
  21. if(side[i] < side[i-1])
  22. swap(side[i], side[i-1]);
  23. }
  24. if(side[0] + side[1] == side[2])
  25. cout << "RIGHT";
  26. else if(side[0] + side[1] > side[2])
  27. cout << "ACUTE";
  28. else cout << "OBTUSE";
  29. }
  30.  
  31. int main()
  32. {
  33. for(int i = 0; i < 3; i++)
  34. cin >> x[i] >> y[i];
  35. solve();
  36. return 0;
  37. }
  38.  
Success #stdin #stdout 0s 5324KB
stdin
-10 -6 3 1 0 4
stdout
OBTUSE