Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {int aux,c1,c2,g,n;
- cin>>n;
- aux=n;int p=1;n=0;
- while(aux!=0)
- {c1=aux%10;
- n=n+p*c1;
- p=p*10;
- c2=(aux/10)%10;
- if(c1>c2) g= c1- c2;
- else g=c2-c1;
- n=n+p*g;
- p=p*10;
- n=n+c2*p;
- aux=aux/10;
- }
- cout<<n;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement