组合数的话到23左右确实是会爆longlong
这就要用大数了??
不我选择接着暴力
用double
确实wa了好几次
但finally
double是可以过的
printf控制输出还要%.0lf对吧
不要小数点后面的
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
int a,b;
scanf("%d",&t);
while(t--)
{
double m=1,n=1;
scanf("%d%d",&a,&b);
if(a<b)
cout<<0<<endl;
else if(a==b)
cout<<1<<endl;
else
{
for(int i=1;i<=b;i++,a--)
{
m*=a;
n*=i;
}
printf("%.0lf\n", m / n);
}
}
return 0;
}