Advertisement
marius7122

Untitled

Jul 9th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int n, inv;
  6.  
  7. int main ()
  8. {
  9.     cout<<"n= "; cin>>n;
  10.  
  11.     while(n > 0)
  12.     {
  13.         inv = inv * 10 + n % 10;
  14.  
  15.         n = n / 10;
  16.     }
  17.  
  18.     cout<<inv;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement