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