mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
ddd34a4f1c
2000-2099
15 lines
271 B
C++
15 lines
271 B
C++
#include<iostream>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
__int64 ans[100] = {0,3,8};
|
|
int n;
|
|
for (int i = 3; i < 100; i++)
|
|
ans[i] = 2 * (ans[i - 1] + ans[i - 2]);
|
|
while (cin>>n)
|
|
{
|
|
cout << ans[n] << endl;
|
|
}
|
|
return 0;
|
|
}
|