Created
October 30, 2016 18:04
-
-
Save nasko90/b8a2f3ce08d24190fb4f57ec1d541141 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Numerics; | |
class PrintMyName | |
{ | |
static void Main() | |
{ | |
int n = int.Parse(Console.ReadLine()); | |
BigInteger factoriel2N =1; | |
BigInteger factorielN = 1; | |
BigInteger factoriel = 1; | |
BigInteger catalanNum; | |
for (int i = 1; i <= n * 2; i++) | |
{ | |
factoriel2N *= i; | |
if (i <= n ) | |
{ | |
factorielN *= i; | |
} | |
if (i <= n +1) | |
{ | |
factoriel *= i; | |
} | |
} | |
catalanNum = factoriel2N / (factorielN * factoriel); | |
Console.WriteLine(catalanNum); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment