Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int n, nx, c, p=1, p2=1, t=0;
- cin>>n;
- nx=n;
- while (nx!=0)
- {
- c=n-nx%10*p;
- nx=nx/10;
- p=p*10;
- while (c!=0)
- {
- if (c%10!=0)
- {
- t=t+c%10*p2;
- p2=p2*10;
- }
- c=c/10;
- }
- }
- cout<<t<<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement