Advertisement
SergeyPGUTI

6.1.7

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