Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
36450 | 毛奕皓MAOYIHAO | 斐波那契数列 | C++ | Accepted | 0 MS | 244 KB | 188 | 2024-01-13 14:48:50 |
#include<iostream> using namespace std; int a[1000]; int n; int main() { cin>>n; a[1]=0; a[2]=1; for(int i=3;i<=n;i++){ a[i]=a[i-1]+a[i-2]; } cout<<a[n]; return 0; }