| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 72360 | 任斌 | 斐波那契数列 | C++ | Accepted | 1 MS | 272 KB | 262 | 2024-05-05 09:42:15 |
#include<iostream> using namespace std; int main() { int k,a=1,b=1,temp; cin>>k; if(k==1) cout<<a<<endl; else if(k==2) cout<<b<<endl; else{ for(int i=3;i<=k;i++){ temp=a+b; a=b; b=temp; } cout<<b<<endl; } return 0; }