Advertisement
Josif_tepe

Untitled

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