题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/bfd8234bb5e84be0b493656e390bdebf
#include <iostream> using namespace std; //递归 int num(int m, int n){ if (m == 0 || m == 1 || n == 1){ return 1; } if (m < n){ return num(m, m); }//苹果多于盘子 return num(m, n - 1) + num(m - n, n); } int main() { int m, n; //n个盘子,m个苹果 while (cin >> m >> n) { cout << num(m, n) << endl; } return 0; }#23届找工作求助阵地##我的实习求职记录##14天打卡计划##春招##零基础学习C++#