konevLOX

Untitled

Nov 13th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1.         static double Fact(int a)
  2.         {
  3.             double F = 1;
  4.             for (int i = 1; i <= a; i++)
  5.             {
  6.                 F *= i;
  7.             }
  8.             return F;
  9.         }
  10.         static void Main(string[] args)
  11.         {
  12.             int n = int.Parse(ReadLine());
  13.             int k = int.Parse(ReadLine());
  14.             double C = Fact(n) / (Fact(k) * Fact(n - k));
  15.             WriteLine(C);
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment