BSO90

Untitled

Jun 4th, 2021
566
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. class Program
  7. {
  8.     static void Main()
  9.     {
  10.         int n = int.Parse(Console.ReadLine());
  11.         int factoriel = 1;
  12.         if (n > 0)
  13.         {
  14.             for (int i = 1; i <= n; i++)
  15.             {
  16.                 factoriel = factoriel * i;
  17.             }
  18.         }
  19.        
  20.         Console.WriteLine($"{factoriel}");
  21.     }
  22. }
  23.  
RAW Paste Data