题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/4f0c1e21010e4d849bde5297148e81d9
#include<cstdio> int fun(int m, int n) { if (n == 1 ) { return 1; } if ( m == 0 ) { return 1; } if (n > m ) { return fun(m, m); } else { return fun(m - n, n) + fun(m, n - 1); } } int main() { int m, n ; //m个水果,n个盘子 scanf("%d%d", &m, &n); printf("%d\n", fun(m, n)); }