Advertisement
artur99

Untitled

Jul 5th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void duplicare(unsigned int &n){
  5. int c, d = 1;
  6.  
  7. while(n/d > 0){
  8. c = n/d%10;
  9. if(c%2==0){
  10. n = ((n/d)*10 + c/2)*d + n%d;
  11. d = d * 10;
  12. }
  13. d = d * 10;
  14. }
  15. }
  16. int main(){
  17. unsigned int n = 3490;
  18. duplicare(n);
  19. cout<<n;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement