#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
#define ll long long
#define MAXN 1000
int n;
ll c[30 + 1];
void f()
{
c[1] = 1;
for (int i = 2; i <= 30; i++)
{
c[i] = c[i - 1] * (4 * i - 2) / (i + 1);
}
}
int main()
{
f();
while (scanf("%d", &n) != EOF && n != 0)
{
printf("%lld\n", c[n]);
}
return 0;
}
HDU 4165 卡特兰数
最新推荐文章于 2021-08-29 19:27:16 发布