Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- public static void Main()
- {
- double first = int.Parse(Console.ReadLine());
- double second = int.Parse(Console.ReadLine());
- double firstNumberFactorial = GetFactorial(first);
- double secondNumberFactorial = GetFactorial(second);
- double result = firstNumberFactorial / secondNumberFactorial;
- Console.WriteLine($"{result:f2}");
- }
- public static double GetFactorial(double number)
- {
- double factorial = number;
- for (double i = number - 1; i >= 1; i--)
- {
- factorial *= i;
- }
- return factorial;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement