uva 991

时间:2024-04-08 23:07:50

卡特兰数  最后不输出空行。。。

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <string>
#include <cstring>
#include <algorithm>
#include <iostream>
#define maxn 1010
#define INF 0x7fffffff
#define inf 10000000
#define MOD 34943
#define ull unsigned long long
#define ll long long
using namespace std; int main()
{
int ans[15] = {1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796}, n;
bool flag = false;
while(scanf("%d", &n) == 1)
{
if(flag) puts("");
else flag = true;
printf("%d\n", ans[n]);
}
return 0;
}