02.11.2014, 00:28
Assuming you have to use only modulus and division, you can do something like this:
I wrote the code in C syntax.
Код:
num = num - ( ( num / 100 % 10 ) * 100 ) - ( num % 10 ) + d * 100 + d; cout << (char)(ch-1) << num << (char)(ch+1);