fork(2) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. double a, b, c;
  7. cin >> a >> b >> c;
  8. double angle0 = acos((b * b + c * c - a * a) / (2 * b * c));
  9. double angle1 = acos((c * c + a * a - b * b) / (2 * a * c));
  10. double angle2 = acos((a * a + b * b - c * c) / (2 * a * b));
  11. double maxAngle = angle0 > angle1 ? (angle0 > angle2 ? angle0 : angle2) : (angle1 > angle2 ? angle1 : angle2);
  12. if(maxAngle > M_PI / 2) {
  13. cout << "Тупоугольный";
  14. } else if(maxAngle == M_PI / 2) {
  15. cout << "Прямоугольный";
  16. } else {
  17. cout << "Остроугольный";
  18. }
  19. cout << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3464KB
stdin
1 1 1
stdout
Остроугольный