I need help with solving this problem. I can use numbers 20,10,5,2 or 1 and have to display all posible combinations.
input: 11
output:
10,1
5,5,1
5,2,2,2
5,2,2,1,1
5,2,1,1,1,1
5,1,1,1,1,1,1
2,2,2,2,2,1
2,2,2,2,1,1,1
2,2,2,1,1,1,1,1
2,2,1,1,1,1,1,1,1
2,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1
i m a newbie so i still lack knowlage to understand what the advanced programs say. is there mybe a version of program that only involves "for" and "if" functions ?
is there mybe a version of program that only involves "for" and "if" functions ?
Neither "for" nor "if" are functions and I doubt a version using only "for" and "if" would be readable to anyone. The first link describes an algorithm in pseudo-code. Implement the algorithm with whatever constructs you are familiar with.