本文共 455 字,大约阅读时间需要 1 分钟。
#include <cstdlib>#include <iostream>using namespace std;int getCount(int m, int n){ if(m == 0 || n == 1) return 1; if(m < n) return getCount(m, m); return getCount(m, n - 1) + getCount(m - n, n);}int main(int argc, char *argv[]){ int caseCount; cin >> caseCount; while(caseCount-- > 0) { int m, n; cin >> m >> n; cout << getCount(m, n) << endl; } return EXIT_SUCCESS;}
转载地址:http://ibkqb.baihongyu.com/