Josif_tepe

Untitled

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