Advertisement
Daiana_UWU

ec

Nov 19th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5.     int n, nx, c, p=1, p2=1, t=0;
  6.     cin>>n;
  7.     nx=n;
  8.     while (nx!=0)
  9.     {
  10.         c=n-nx%10*p;
  11.         nx=nx/10;
  12.         p=p*10;
  13.         while (c!=0)
  14.         {
  15.             if (c%10!=0)
  16.             {
  17.                 t=t+c%10*p2;
  18.                 p2=p2*10;
  19.             }
  20.             c=c/10;
  21.         }
  22.     }
  23.     cout<<t<<" ";
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement