Advertisement
Mirbek

Сумма

Jan 20th, 2022
801
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement