daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. int main()
  3. {int aux,c1,c2,g,n;
  4. cin>>n;
  5.     aux=n;int p=1;n=0;
  6.     while(aux!=0)
  7.     {c1=aux%10;
  8.        n=n+p*c1;
  9.        p=p*10;
  10.        c2=(aux/10)%10;
  11.        if(c1>c2) g= c1- c2;
  12.          else g=c2-c1;
  13.         n=n+p*g;
  14.         p=p*10;
  15.         n=n+c2*p;
  16.         aux=aux/10;
  17.     }
  18.     cout<<n;
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top