hopingsteam

Untitled

May 22nd, 2020
1,427
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void duplicare(int n, int &d)
  2. {
  3.     d = 0;
  4.     int p = 1, copie = n;
  5.     while(n)
  6.     {
  7.         int c = n % 10;
  8.         if(c % 2 == 0)
  9.         {
  10.             d = d + c * p;
  11.             p = p * 10;
  12.             d = d + c * p;
  13.         }
  14.         else
  15.             d = d + c * p;
  16.         p = p * 10;
  17.         n = n / 10;
  18.     }
  19.     if(d == copie)
  20.         d = -1;
  21. }
RAW Paste Data