提交时间:2023-11-25 08:07:36

运行 ID: 111789

#include<bits/stdc++.h> using namespace std; int a[1010] = {1,2}; signed main(){ int n; scanf("%d",&n); for(int i = 2;i < n;i++){ a[i] += a[i-1]+a[i-2]; } printf("%d",a[n-1]); return 0; }