Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigInteger;
- import java.util.Scanner;
- public class JavaApplication1 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int n = input.nextInt() + 1;
- BigInteger p = new BigInteger("1");
- BigInteger d = new BigInteger("1");
- for (int i = 2; i <= n; i++) {
- p = p.multiply(new BigInteger(Integer.toString(n+i)));
- d = d.multiply(new BigInteger(Integer.toString(i)));
- }
- p = p.divide(d);
- System.out.println(p);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement