// Run time: 0.000
#include <stdio.h>
void combination(int N, int M);
int main()
{
int N, M;
while (true)
{
scanf("%d%d", &N, &M);
if (!N && !M) break;
if (M > N/2)
M = N - M;
combination(N, M);
}
return 0;
}
void combination(int N, int M)
{
int i;
double prod = 1;
for ( i = 0; i < M; i++)
prod *= double(N--)/double(i+1);
printf("%.0lf\n", prod);
}
沒有留言:
張貼留言