Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
99505 | 15186769129 | 斐波那契数列 | C++ | Wrong Answer | 2 MS | 268 KB | 328 | 2024-11-29 22:47:25 |
#include<iostream> using namespace std; int main(){ int n; cin>>n; for(int j=1;j<=n;j++){ int k; int x=1,y=1,z; cin>>k; if(k==1 || k==2){ cout<<x<<endl; } else{ for(int i=3;i<=k;i++){ z=x+y; x=y; y=z; } cout<<z<<endl; } } return 0; }
------Input------
36
------Answer-----
14930352
------Your output-----
2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453 2122638453