Advertisement
AlezM

Untitled

Jul 7th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. // Liza1.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include <math.h>
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     int input[3];
  12.     int a, b, c;
  13.  
  14.     cin >> input[0] >> input[1] >> input[2];
  15.  
  16.     for (int i = 0; i < 2; i++) {
  17.         for (int j = 0; j < 3 - i - 1; j++) {
  18.             if (input[j] < input[j + 1]) {
  19.                 int temp = input[j];
  20.                 input[j] = input[j + 1];
  21.                 input[j + 1] = temp;
  22.             }
  23.         }
  24.     }
  25.  
  26.     for (int i = 0; i < 3; i++) {
  27.         cout << input[i] << "  ";
  28.     }
  29.     cout << endl;
  30.  
  31.     a = input[0];
  32.     b = input[1];
  33.     c = input[2];
  34.  
  35.  
  36.     if (a >= b + c) {
  37.         cout << "Impisible" << endl;
  38.     }
  39.     else if (a*a > b*b + c*c) {
  40.         cout << "TUPOI" << endl;
  41.     }
  42.     else if (a*a == b*b + c*c) {
  43.         cout << "PRYAMOI" << endl;
  44.     }
  45.     else if (a*a < b*b + c*c) {
  46.         cout << "OSTRYI" << endl;
  47.     }
  48.  
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement