题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1570
题意:求组合数 数据很小水过。
code:
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int a[15],nn=1;
for(int i=1;i<12;i++){
nn*=i;
a[i]=nn;
}
a[0]=1;
int t,n,m;
char c;
cin>>t;
while(t--){
cin>>c>>n>>m;
if(c=='A')
printf("%d\n",a[n]/a[n-m]);
else if(c=='C')
printf("%d\n",a[n]/a[m]/a[n-m]);
}
return 0;
}