Advertisement
Josif_tepe

Untitled

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