Josif_tepe

Untitled

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