Advertisement
Mirbek

Сумма

Jan 20th, 2022
924
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.     long long n, revN = 0, temp;
  7.  
  8.     cin >> n;
  9.  
  10.     temp = n;
  11.  
  12.     while (temp > 0) {
  13.         int x = temp % 10;
  14.         revN = revN * 10 + x;
  15.         temp /= 10;
  16.     }
  17.  
  18.     cout << n + revN << endl;
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement