jcjkyx110507 @ 2023-12-19 16:17:06
#include<bits/stdc++.h>
const int maxn=35;
long long f[maxn];
int main(){
int n;
scanf("%d",&n);
if(n==0) {cout<<"0";return 0;}
f[1]=1,f[2]=2;
for(int i=3;i<=n;i++)
f[i]=f[i-1]+f[i-2];
printf("%lld",f[n]);
return 0;
}
by jcjkyx110507 @ 2023-12-19 16:44:48
@rwhy 对
by jcjkyx110507 @ 2023-12-19 16:45:45
@xiaoshumiao 你能给我看看你的代码吗
by xiaoshumiao @ 2023-12-19 16:52:21
@jinzhilong 右转题解区