题解
2025-06-06 19:08:12
发布于:浙江
3阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c,d,e;
cin>>a;
for(int i=1;i<=a;i++){
cin>>b;
if(b==1||b==2) cout<<"1"<<endl;
else{
c=1;
d=1;
for(int j=1;j<=b-2;j++){
e=c+d;
c=d;
d=e;
}
cout<<e<<endl;
}
}
return 0;
}
这里空空如也
有帮助,赞一个