课堂实验5-2
#include<stdio.h> int main() { int m,n; float result,sum; float fact(int n); printf("enter m and n:"); scanf("%d%d",&m,&n); sum=fact(m-n); result=fact(m)/(fact(n)*sum); printf("result=%.0f\n",result); return 0; } float fact(int n) { int i; float result; result=1; for(i=1;i<=n;i++){ result=result*i; } return result; }