Page 2 of 2

Re: 10520 - Determine it

Posted: Fri Nov 21, 2014 3:29 pm
by lighted
Yes it is possible to solve this problem also with a bottom-up approach. :D

Loops should be as follows

Code: Select all

for (i = n; i >= 1; i--)
{
    for (j = 1; j <= n; j++)
    {
        if (i >= j)
        {
            ..