VelizarAvramov

13. Factorial

Nov 25th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace _13._Factorial
  5. {
  6.     class Factorial
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             BigInteger n = BigInteger.Parse(Console.ReadLine());
  11.             BigInteger factorial = 1;
  12.             for (int i = 1; i <= n; i++)
  13.             {
  14.                 factorial *= i;
  15.             }
  16.             Console.WriteLine(factorial);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment