题解 | #放苹果#
放苹果
http://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
#include <stdio.h>
int f(int m,int n){
if ((m==0)||(n==1)) return 1;
else if(m<n) return f(m,m);
return(f(m-n,n)+f(m,n-1));
}
int main(void) {
int m,n;
while(scanf("%d",&m)!=-1){
scanf("%d",&n);
printf("%d\n",f(m,n));
}
return 0;
}