Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- namespace methods_exerci
- {
- class Program
- {
- static void Main(string[] args)
- {
- long number = long.Parse(Console.ReadLine());
- long divide = long.Parse(Console.ReadLine());
- double result = Factorial(number) / Factorial(divide);
- Console.WriteLine($"{result:f2}");
- }
- static double Factorial(long number)
- {
- long sum2 = 1;
- if (number == 0)
- {
- sum2 = 1;
- }
- else
- {
- for (int i = 2; i <= number; i++)
- {
- sum2 *= (i);
- }
- }
- return sum2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement