+0  
 
0
159
1
avatar

In how many ways can I collect a total of 20 dollars from 4 people, if each person can give any number of dollars from 0 to 10?

 Jun 26, 2020
 #1
avatar
0

a=0;p=0; b=0;c=0;d=0;n=a+b+c+d;if(n==20, goto loop, goto next);loop:p=p+1;printp," =",a,b,c,d;next:a++;if(a<11, goto5,0);a=0;b++;if(b<11, goto5, 0);a=0;b=0;c++;if(c<11, goto5,0);a=0;b=0;c=0;d++;if(d<11, goto5, discard=0;printp

 

OUTPUT = 891 ways [From giving zero to $10 each]

 Jun 26, 2020

11 Online Users

avatar
avatar