All about problems in Volume 105. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Moderator: Board moderators
- Posts: 585
- Joined: Wed Jun 11, 2014 9:56 pm
- Location: Kyrgyzstan, Bishkek
Yes it is possible to solve this problem also with a bottom-up approach.
Loops should be as follows
Code: Select all
for (i = n; i >= 1; i--)
for (j = 1; j <= n; j++)
if (i >= j)
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman