题解
计算组合数即可1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using namespace std;
typedef unsigned long long ll;
ll C[105][105];
ll read(){
ll x=0;char c=getchar();
while(c<'0'||c>'9')c=getchar();
while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();
return x;
}
void build(){
for(ll i=0;i<=100;i++)
C[i][0]=1;
for(ll i=1;i<=100;i++)
for(ll j=1;j<=i;j++)
C[i][j]=C[i-1][j]+C[i-1][j-1];
}
int main(){
build();
ll u,v;
for(;;){
u=read(),v=read();
if(!u&&!v)return 0;
printf("%llu things taken %llu at a time is %llu exactly.\n",u,v,C[u][v]);
}
return 0;
}