题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1023
解析:第一个自己写的Java程序,纪念下。
import java.util.Scanner;
import java.math.*;
public class Main {
public static void main(String []argu){
Scanner in = new Scanner(System.in);
BigInteger a [] = new BigInteger [102];
a[1] = BigInteger.valueOf(1);
for( int i = 2 ; i <= 100; i++ ){
a[i] = a[i-1].multiply(BigInteger.valueOf(4*i-2)).divide(BigInteger.valueOf(i+1));
}
int x;
while( in.hasNext() ){
x = in.nextInt();
System.out.println(a[x]);
}
in.close();
}
}