提交时间:2023-11-25 09:52:59

运行 ID: 112048

#include <bits/stdc++.h> using namespace std; int a[1005]; int main() { int n; cin >> n; a[1] = 1; a[2] = 2; for(int i = 3;i <= n;i++) a[i] = a[i - 1] + a[i - 2]; cout << a[n]; return 0; }