I take literally no credit for this, as I just "translated" Chris++' code above to C++:
CPP (Click to show)
By the time I figured it out, "WeirdSexy" had already posted a CPP solution that would be similar to mine, therefore I just translated Chris++' code for "teh lulz". Doesn't really count, but ohwell.
Edited by bruflot - 7/16/12 at 3:22pm
CPP (Click to show)
Code:
int r(int n, int i = 0){
if(n < 10)
return i * 10 + n;
else
i = i * 10 + (n%10);
return r(n / 10, i);
}
By the time I figured it out, "WeirdSexy" had already posted a CPP solution that would be similar to mine, therefore I just translated Chris++' code for "teh lulz". Doesn't really count, but ohwell.
Edited by bruflot - 7/16/12 at 3:22pm





