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


查看12道真题和解析