2017年noip提高组初赛阅读程序题:
#include <iostream> usingnamespacestd; int g(int m, int n, int x) { int ans = 0; int i; if (n == 1) return1; 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; return0; }
输入:8 4
输出:_________