Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void duplicare(int n,int &d)
- {
- d=0;
- int ok=0,p=1;
- while(n)
- {
- d=n%10*p+d;
- p*=10;
- if(n%2==0)
- ++ok,d=n%10*p+d,p*=10;
- n/=10;
- }
- if(!ok)
- d=-1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement