NOIP 2017普及组初赛试题 阅读程序写结果:
#include<iostream> using namespacestd; int g(int m, intn, int x) { int ans = 0; int i; if (n == 1) return 1; for (i = x; i <= m / n; i++) ans += g(m - i, n - 1, i); return ans; } int main() { int t, m, n; cin >> m >> n; cout << g(m, n, 0) << endl; return 0; }
输入: 7 3
输出:____