#include <stdio.h>
int factional(int n){
int i,result=1;
for (i=n;i>1;i--)
result*=i;
return result;
}
int comb(int m, int k){
int result;
result=factional(m)/factional(k)/factional(m-k);
return result;
}
int main(void) {
int m, k;
printf("%d個の中から%d個を取り出す組み合わせ数は、%d通りです。",m
,k
,comb
(m
,k
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgZmFjdGlvbmFsKGludCBuKXsKaW50IGkscmVzdWx0PTE7CmZvciAoaT1uO2k+MTtpLS0pCiAgcmVzdWx0Kj1pOwpyZXR1cm4gcmVzdWx0Owp9CmludCBjb21iKGludCBtLCBpbnQgayl7CmludCByZXN1bHQ7CnJlc3VsdD1mYWN0aW9uYWwobSkvZmFjdGlvbmFsKGspL2ZhY3Rpb25hbChtLWspOwpyZXR1cm4gcmVzdWx0Owp9CmludCBtYWluKHZvaWQpIHsKaW50IG0sIGs7CnNjYW5mKCIlZCIsJm0pOwkKc2NhbmYoIiVkIiwmayk7CnByaW50ZigiJWTlgIvjga7kuK3jgYvjgoklZOWAi+OCkuWPluOCiuWHuuOBmee1hOOBv+WQiOOCj+OBm+aVsOOBr+OAgSVk6YCa44KK44Gn44GZ44CCIixtLGssY29tYihtLGspKTsKCXJldHVybiAwOwp9Cg==