HDU_1134
http://acm.hdu.edu.cn/showproblem.php?pid=1134
import java.math.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int n;
while(in.hasNextInt())
{
BigInteger n1= BigInteger.valueOf(1);
BigInteger m1= BigInteger.valueOf(1);
int i;
n=in.nextInt();
if(n<=0)
break;
for(i=2*n;i>=n+1;i--)
{ BigInteger j=BigInteger.valueOf(i);
n1=n1.multiply(j);
}
for(i=1;i<n+1;i++)
{ BigInteger j=BigInteger.valueOf(i);
m1=m1.multiply(j);
}
BigInteger m=BigInteger.valueOf(n+1);
System.out.println((n1.divide(m1.multiply(m))));
}
}
}
天行健,君子应自强不息;地势坤,君子应厚德载物!
浙公网安备 33010602011771号