limeng911 @ 2023-05-14 12:02:23
#include<bits/stdc++.h>
using namespace std;
int a[1005];
int zuhe(int x,int y){
int s=1,k=1;
int y1=y,x1=x;
for(int i=1;i<=y;i++){
s*=y1;
y1--;
// cout<<s<<endl;
}
for(int i=1;i<=y;i++){
k*=x1;
x1-- ;
// cout<<k<<endl;
}
return k/s;
}
int main(){
int n,p=0;
cin>>n;
// int x=8,y=2;
// int s=1,k=1;
// int y1=y,x1=x;
// for(int i=1;i<=y;i++){
// s*=y1;
// y1--;
// cout<<s<<endl;
// }
// for(int i=1;i<=y;i++){
// k*=x1;
// x1-- ;
// cout<<k<<endl;
// }
// cout<<k<<' '<<s<<' '<<k/s;
for(int i=0;i<=n;i++){
p+=zuhe(n-i,i);
}
// cout<<zuhe(8,2);
cout<<p;
return 0;
}
by Ginger_he @ 2023-05-14 12:03:33
?自己写啊
by OldDriverTree @ 2023-05-14 12:13:59
@limeng911 自己写,不想写高精用 py 也行
by codejiahui @ 2023-05-14 12:22:47
@limeng911 关注我发你高精
by limeng911 @ 2023-05-18 22:08:40
@codejiahui
by codejiahui @ 2023-05-18 23:26:42
@limeng911 把图撤一下谢谢