Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.WriteLine("Task: I_1");
- static int C(uint n, uint k)
- {
- int[] factorial = new int[n + 1];
- factorial[0] = 1;
- for (int i = 1; i <= n; i++)
- {
- factorial[i] = i * factorial[i - 1];
- }
- return factorial[n] / (factorial[k] * factorial[n - k]);
- }
- static int solve(uint candidates)
- {
- return C(candidates, 5);
- }
- Console.WriteLine("Solve for 8: {0}", solve(8));
- Console.WriteLine("Solve for 10: {0}", solve(10));
- Console.WriteLine("Solve for 11: {0}", solve(11));
Add Comment
Please, Sign In to add comment