Advertisement
DawidG

Zadanie8 - Część 2

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