程序代码:
#include <iostream> using namespace std; int fact(int n) { int temp=1; for(int i=1;i<=n;i++) temp*=i; return temp; } int main() { int m,n; cout<<"Enter m:"; cin>>m; cout<<"Enter n:"; cin>>n; double s; s=fact(n)/(fact(m)*fact(n-m)); cout<<"result ="<<s<<endl; } 加油哦