Advertisement
Josif_tepe

Untitled

Oct 29th, 2021
128
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.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n; // brojot na borjan
  8.     cin >> n;
  9.     int posledna_cifra = n % 10;
  10.     int sredna_cifra = (n / 10) % 10;
  11.     int prva_cifra = n / 100;
  12.     int m = (posledna_cifra * 100) + (sredna_cifra * 10) + prva_cifra; // brojot na gorjan
  13.     if (n > m)
  14.     {
  15.         cout << n << endl;
  16.     }
  17.     else {cout << m << endl;}
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement