14.从m个球中取出n个球的所有组合情况
#include<iostream> using namespace std; int JieCheng(int); int main() { int m,n; int x; cout<<"please input an number: "<<endl; cin>>n>>m; x=JieCheng(m)/(JieCheng(n)*JieCheng(m-n)); cout<<x<<endl; return 0; } int JieCheng(int index) { int p=1; for(int i=1;i<=index;i++) { p*=i; } return p; }