|
|
Kevin Wampler wrote:
>
> Now for a tricker question, say I add another loop:
>
> n = 2
> for(a = n; a > 0; a--)
> for(b = n; b > 0; b--)
> for(c = n; c > 0; c--)
> for(d = n; d > 0; d--)
> for(e = n; e > 0; e--)
> n++
> print n
>
> What are the last five digits printed?
>
Ok, I haven't been able to post today since I've been on airplanes on or
airports without wireless the whole time, but I implemented the solution
and it seems to work, so this problem is totally solvable, and only
takes a fraction of a second on my computer.
It turns out that the solution is actually quite simple too! Possibly
even more so than that to the last puzzle -- although certainly not as
mathematically concise.
Actually pretty fun, so feel free to give it a shot knowing that it does
indeed have a relatively simple solution!
Post a reply to this message
|
|