SHARE
TWEET

Exercise10Catalan

g-stoyanov Dec 4th, 2012 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Numerics;
  3.  
  4. class Exercise10Catalan
  5. {
  6.     static BigInteger Factorial(int factor)
  7.     {
  8.         if (factor > 1)
  9.         {
  10.             return factor * Factorial(--factor);
  11.         }
  12.         return 1;
  13.     }
  14.     static void Main()
  15.     {
  16.         int n = int.Parse(Console.ReadLine());
  17.         Console.WriteLine(Factorial(2*n) / (Factorial(n+1) * Factorial(n)));
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top