hdu1023

时间:2014-12-31 14:23:38   收藏:0   阅读:248
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());
		}
	}
}


原文:http://www.cnblogs.com/gcczhongduan/p/4195527.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!