Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- main()
- {
- int n, s, i, m;
- cin >> n;
- i=0;
- m=n;
- do
- {
- m = m/10;
- i=i+1;
- }
- while (m > 0);
- s=0;
- do
- {
- s = s + (n%10) * pow(10.0,i-1);
- n = n / 10;
- i = i - 1;
- }
- while (i>0);
- cout << s;
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement