Advertisement
Josif_tepe

Untitled

Jan 27th, 2024
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n;
  7.     cin >> n;
  8.    
  9.     int stotki = n % 10;
  10.     int desetki = (n / 10) % 10;
  11.     int edinici = (n / 100) % 10;
  12.    
  13.     int pretvrten_broj = 100 * stotki + 10 * desetki + 1 * edinici;
  14.     if(n > pretvrten_broj) {
  15.         cout << n << endl;
  16.     }
  17.     else {
  18.         cout << pretvrten_broj << endl;
  19.     }
  20.    
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement