package com.njupt.acm;
import java.math.BigInteger;
import java.util.Scanner;
public class POJ_2084 {
public static void main(String[] args) {
BigInteger catalan[] = new BigInteger[102];
catalan[1] = new BigInteger("1");
BigInteger one = new BigInteger("1");
BigInteger two = new BigInteger("2");
BigInteger four = new BigInteger("4");
int i;
for(i = 1 ; i <= 100 ; ++i){
catalan[i+1] = catalan[i].multiply(four.multiply(new BigInteger(i + "")).subtract(two)).divide(new BigInteger(i + "" ).add(one));
}
Scanner scanner = new Scanner(System.in);
int n ;
while(true){
n = scanner.nextInt();
if(n < 0){
break;
}
System.out.println(catalan[n + 1]);
}
}
}
转载于:https://www.cnblogs.com/james1207/p/3357905.html