#include "stdio.h"
__int64 fact(__int64 n){
return n>1 ? n*fact(n-1) : 1;
}
int main(int argv,char *argc[]){
int m,n;
printf("Input m & n(int m,n>=0, m>=n)...\n");
if(scanf("%d%d",&m,&n)!=2 || n<0 || m<0 || n>m || m>20){
printf("Input error, exit...\n");
return 0;
}
printf("C(%d,%d) = %I64d\n",m,n,fact(m)/fact(n)/fact(m-n));
return 0;
}
运行样例: