include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
const int N=1e5+10;
int C[N];
int div(int A[],int asize,int b,int&r){
int t=0;
r=0;
for(int i= asize-1;i>=0;i–){
r=r*10+A[i];
A[i]=r/b;
r%=b;
}
int index =asize-1;
while(index>0&&!A[index])index–;
return index+1;
}
int mul(int A[],int asize,int b){
int t=0,i=0;
for(i=0;i[HTML_REMOVED]0&&!A[index])index–;
return index+1;
}
int combi(int a,int b,int A[]){
int asize,r;
A[0]=1,asize=1;
for(int i=a;i>=a-b+1;i–)
asize=mul(A,asize,i);
for(int i=b;i>=1;i–)
asize=div(A,asize,i,r);
return asize;
}
int main(int argc, char** argv) {
int a,b;
cin>>a>>b;
int A[N];
int size=combi(a,b,A);
for(int i=size-1;i>=0;i–){
printf(“%d”,A[i]);
}
return 0;
}
建议学习Markdown。