练一练java大数
/**************************************************************
Problem: 2822
User: syh0313
Language: Java
Result: Accepted
Time:920 ms
Memory:19596 kb
****************************************************************/
import
java.math.BigInteger;
import
java.util.Scanner;
public
class
Main {
public
static
void
main(String[] args){
Scanner cin=
new
Scanner(System.in);
BigInteger a=BigInteger.valueOf(
1
),b=BigInteger.valueOf(
1
);
int
i,n;
n=cin.nextInt();
for
(i=
1
;i<=
2
*n;i++) a=a.multiply(BigInteger.valueOf(i));
for
(i=
1
;i<=n;i++) b=b.multiply(BigInteger.valueOf(i));
for
(i=
1
;i<=n+
1
;i++) b=b.multiply(BigInteger.valueOf(i));
System.out.println(a.divide(b));
}
}