Advertisement
Josif_tepe

Untitled

Mar 16th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n;
  9.     string s = "";
  10.     while(n > 0) {
  11.         s += (n % 10) + '0';
  12.         n /= 10;
  13.     }
  14.     reverse(s.begin(), s.end());
  15.     cout << s << endl;
  16.     return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement