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