NOIP2017 阅读程序
2.
#include<bits/stdc++.h> using namespace std; int g(int m, int n, 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
输出:_________
发表评论