Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. import java.math.BigInteger;
  2. import java.util.Scanner;
  3.  
  4. public class JavaApplication1 {
  5.    
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.        
  9.         int n = input.nextInt() + 1;
  10.        
  11.         BigInteger p = new BigInteger("1");
  12.         BigInteger d = new BigInteger("1");
  13.        
  14.         for (int i = 2; i <= n; i++) {
  15.             p = p.multiply(new BigInteger(Integer.toString(n+i)));
  16.             d = d.multiply(new BigInteger(Integer.toString(i)));
  17.         }    
  18.        
  19.         p = p.divide(d);
  20.        
  21.         System.out.println(p);
  22.     }
  23.    
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement