Kacper_Michalak

Seria 2 Zadanie 8

Nov 7th, 2020 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int x,y,z;
  8.  
  9.     cout << "Podaj pierwsza liczbe: " << endl;
  10.     cin >> x;
  11.     cout << "Podaj druga liczbe: " << endl;
  12.     cin >> y;
  13.     cout << "Podaj trzecia liczbe: " << endl;
  14.     cin >> z;
  15.  
  16.     if( x < y)
  17.     {
  18.         if( x < z)
  19.         {
  20.             if( z < y)
  21.             {
  22.                 cout << x << " " << z << " " << y << " ";
  23.             }
  24.             else
  25.             {
  26.                 cout << x << " " << y << " " << z << " ";
  27.             }
  28.         }
  29.         else if( z < y )
  30.         {
  31.             cout << z << " " << x << " " << y << " ";
  32.         }
  33.         else
  34.         {
  35.             cout << z << " " << y << " " << x << " ";
  36.         }
  37.     }
  38.     else if ( y < z)
  39.     {
  40.         if( x < z)
  41.         {
  42.             cout << y << " " << x << " " << z << " ";
  43.         }
  44.         else{
  45.             cout << y << " " << z << " " << x << " ";
  46.         }
  47.     }
  48.     return 0;
  49. }
  50.  
Advertisement
Add Comment
Please, Sign In to add comment