Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1869 | 杨洋杰 | 斐波那契数列 | C++ | Accepted | 0 MS | 260 KB | 318 | 2023-11-25 18:14:05 |
#include<iostream> using namespace std; int main(){ int q=1,w=1,e,k; cin>>k; if(k>=1&&k<=46){ for(int i=3;i<=k;i++){ e=q+w; q=w; w=e; } if(k==1||k==2) cout<<"1"; else cout<<e; } return 0; }