I am working on my school assignment that reads
for a given no. find no. of possible ways to get that no. adding digits from a given set of no.
i.e,
if I am given a set of No. a =1, b=2, c=3, d=4, e=5, f=6
and another no b=7
I need to find the no. of possible ways to get & adding a, b, c, d, e, f.
Repetition of digits is allowed.
Like in the above case I can get 7 in following ways:
- 4+3
- 5+2
- 4+2+1
- 6+1
- 1+1+1+1+1+1+1
- 2+2+2+1
- and more
How can I achieve the goal??Their are solutions for the problem in different languages but I don't know any lang except for C, C++;