Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Functions
- {
- class Program
- {
- static private double Factorial(double n)
- {
- if (n == 1 || n == 0)
- {
- return 1;
- }
- else
- return n * Factorial(n - 1);
- }
- private static void Main(string[] args)
- {
- double n = double.Parse(Console.ReadLine());
- double k = double.Parse(Console.ReadLine());
- double result = Factorial(n) / Factorial(k);
- Console.WriteLine($"{result:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement