Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _8._Factorial_Division
- {
- class Program
- {
- static void Main(string[] args)
- {
- long fact = long.Parse(Console.ReadLine());
- long devision = long.Parse(Console.ReadLine());
- long sum = fact;
- double num1 = GetFactorial(fact);
- double num2 = GetFactorial(devision);
- Console.WriteLine($"{num1 / num2:f2}");
- }
- private static double GetFactorial(long number)
- {
- for (long i = number-1; i >= 1; i--)
- {
- number = number * i;
- }
- return number;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment