Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Напишете програма, която пресмята N!/K! за дадени N и K (1<K<N).
- */
- using System;
- class DivideFactorials
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int k = int.Parse(Console.ReadLine());
- int result = 1;
- if ((k > 1) && (k < n))
- {
- for (int i = k + 1; i <= n; i++)
- {
- result *= i;
- }
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement