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