Răspuns:
#include <iostream>
using namespace std;
void f( int&x, int y )
{
x = 0;
int cif[ 100 ], k = 0;
while( y != 0 )
{
cif[ k ] = y % 10;
y /= 10;
++k;
}
for( int i = k - 1; i >= 0; --i )
{
x = x * 10 + cif[ i ];
if( cif[ i ] % 2 == 0 )
{
x = x * 10 + cif[ i ] / 2;
}
}
}
int main()
{
int x = 0;
f( x, 35 );
cout << x;
return 0;
}
Explicație: