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