Advertisement
Josif_tepe

Untitled

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