Advertisement
STANAANDREY

dw_inv

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