Put Apple time limit:2000/1000ms (java/other) Memory limit:20000/10000k (Java/other) total submission (s): Accepted Sub Mission (s): 14Problem description The same apples on the N same plate, allowing some plates to be left empty, and asking how many different ways are there? (denoted by k) 5,1,1 and 1,5,1 are the same kind of sub-method.
The first line of input is the number of test data t (0 <= T <= 20). Each of the following lines contains two integers m and n, separated by a space. 1<=m,n<=10.
Output to the input of each set of data m and N, with a row of the corresponding K.
Sample INPUT1 7 3
Sample Output8
Sourcepku
1#include <stdio.h>2 intCintMintN)3 {4 if(m==0|| n==1)5 return 1;6 if(m<0)7 return 0;8 returnC (m-n,n) +c (m,n-1);9 }Ten One intMain () A { - intT,m,n; -scanf"%d",&T); the while(t--) - { -scanf"%d%d",&m,&N); -printf"%d\n", C (m,n)); + } - return 0; +}View Code