Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- if (n < 1)
- {
- Console.WriteLine("Invalid input,Please input N bigger or equal to 1!");
- }
- else
- {
- BigInteger factoriel = 1;
- int temp = n+1;
- int temp2 = n;
- for (int i = 2*n; i > 1; i--)
- {
- factoriel *= i;
- if (temp==i)
- {
- factoriel /= temp;
- temp--;
- }
- if (temp2 == i)
- {
- factoriel /= temp2;
- temp2--;
- }
- }
- Console.WriteLine(factoriel);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement