OJ-Problems-Source/HDOJ/2047_autoAC.cpp

15 lines
271 B
C++
Raw Normal View History

#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;
}