提交时间:2023-10-04 09:08:06
运行 ID: 104757
#include<bits/stdc++.h> using namespace std; #define int long long int a[55],n; signed main() { a[1]=3, a[2]=7; cin>>n; for(int i=3;i<=n;++i) a[i]=a[i-1]*2+a[i-2]; cout<<a[n]; return 0; }