提交时间:2023-11-25 09:15:16
运行 ID: 111945
#include<bits/stdc++.h> using namespace std; int a[105]; 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]; }