子集和问题

计算机算法设计与分析  第3版》 王晓东

eg. from geeksforgeeks

Given 3 numbers {1, 3, 5}, we need to tell
the total number of ways we can form a number 'N' 
using the sum of the given three numbers.
(allowing repetitions and different arrangements).

Total number of ways to form 6 is : 8
1+1+1+1+1+1
1+1+1+3
1+1+3+1
1+3+1+1
3+1+1+1
3+3
1+5
5+1
原文地址:https://www.cnblogs.com/guxuanqing/p/6675665.html