mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
ed2de2e423
1500-1599
23 lines
387 B
C++
23 lines
387 B
C++
#include <stdio.h>
|
|
int jc(int n)
|
|
{
|
|
int i,t=1;
|
|
if(n==0) return 1;
|
|
for(i=n;i>0;i--) t *= i;
|
|
return t;
|
|
}
|
|
int main()
|
|
{
|
|
int k,t,n,m;
|
|
char lt;
|
|
scanf("%d",&t);
|
|
while(t--)
|
|
{
|
|
scanf(" %c%d%d",<,&n,&m);
|
|
if(lt=='A') k = jc(n)/jc(n-m);
|
|
else k = jc(n)/(jc(m)*jc(n-m));
|
|
printf("%d\n",k);
|
|
}
|
|
return 0;
|
|
}
|