首页 > 其他 > 详细

hdu1023

时间:2014-12-31 14:23:38      阅读:247      评论:0      收藏:0      [点我收藏+]
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());
		}
	}
}


hdu1023

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!