ll C(int a,int b)
{
int i=0;
double Cans=1;
if(a==0)return 0;
if(b==0)return 1;
while(i<b){
Cans*=(a-i);
Cans/=i+1;
i++;
}
return (ll)Cans;
}
/*
55为界
求C几几
20为界
*/
ll C(int a,int b)
{
int i=0;
ll Cans=1;
if(a==0)return 0;
if(b==0)return 1;
while(i<b){
Cans*=(a-i);
i++;
}
while(b){
Cans/=b;
b--;
}
return Cans;
}
文中的ll指的是long long。
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/qq_27803491/article/details/47790233