hdu1023

import java.math.BigInteger;
import java.util.Scanner;
public class Main
{
	static BigInteger fac(BigInteger n)
	{
		BigInteger result=BigInteger.ONE;
		for(BigInteger i=BigInteger.ONE;!i.equals(n.add(BigInteger.ONE));i=i.add(BigInteger.ONE))
		{
			result=result.multiply(i);
		}
		return result;
	}
	public static void main(String args[])
	{
		Scanner cin=new Scanner(System.in);
		while(cin.hasNext())
		{
			BigInteger n=cin.nextBigInteger();
			BigInteger total=fac(n.add(n)).divide(n.add(BigInteger.ONE).multiply(fac(n).pow(2)));
			System.out.println(total.toString());
		}
	}
}


原文地址:https://www.cnblogs.com/zfyouxi/p/4502425.html