Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44137 | 惠子铭 | 斐波那契数列 | C++ | Accepted | 0 MS | 248 KB | 198 | 2024-03-29 14:58:47 |
#include<iostream> using namespace std; int main(){ int k,a[50]; cin>>k; a[1]=0,a[2]=1; for(int i=3;i<=k;i++) a[i]=a[i-1]+a[i-2]; cout<<a[k]; return 0; }