Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- class CatalanNumbers
- {
- static void Main()
- {
- byte n = byte.Parse(Console.ReadLine());
- BigInteger factorielN = 1, factoriel2N = 1, factorielNplus1 = 1;
- for (int i = 1; i <= n; i++)
- factorielN *= i;
- for (int i = 1; i <= (2 * n); i++)
- factoriel2N *= i;
- for (int i = 1; i <= (n + 1); i++)
- factorielNplus1 *= i;
- Console.WriteLine(factoriel2N / (factorielN * factorielNplus1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement