Guest User

Untitled

a guest
Jul 18th, 2021
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _8._Factorial_Division
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             long fact = long.Parse(Console.ReadLine());
  10.             long devision = long.Parse(Console.ReadLine());
  11.             long sum = fact;
  12.  
  13.             double num1 = GetFactorial(fact);
  14.             double num2 = GetFactorial(devision);
  15.  
  16.             Console.WriteLine($"{num1 / num2:f2}");
  17.         }
  18.  
  19.         private static double GetFactorial(long number)
  20.         {
  21.             for (long i = number-1; i >= 1; i--)
  22.             {
  23.                 number = number * i;
  24.             }
  25.  
  26.             return number;
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment