标签:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int i,j,n,k,a[][]=new int[201][7];
a[1][1]=1;
n=sc.nextInt();
k=sc.nextInt();
for(i=2;i<=n;i++)
for(j=1;j<=k;j++)
if(i>=j)
a[i][j]=a[i-j][j]+a[i-1][j-1];
System.out.println(a[n][k]);
}
}
标签:
原文地址:http://www.cnblogs.com/watchfree/p/5769657.html