#include <iostream>
#include <string.h>
#include <string>
using namespace std;
int f(int m, int n) {
if (n == 0) {
return 1;
}
if (m == 0) {
return f(m + 1, n - 1);
}
else
return f(m - 1, n) + f(m + 1, n - 1);
}
int main()
{
int n;
cin >> n;
cout << f(0, n) << endl;
return 0;
}
[Coursera]数据结构基础_Week3_栈与队列_Q2
最新推荐文章于 2021-07-13 09:59:49 发布