Description
Input
Output
Sample Input
Sample Output
#include<iostream> using namespace std; __int64 s[45]; void f() { s[0]=0; s[1]=3; s[2]=8; for(int i=3;i<43;i++) s[i]=2*(s[i-1]+s[i-2]); } int main() { int n; f(); while(cin>>n)cout<<s[n]<<endl; //system("pause"); return 0; }
原文:http://www.cnblogs.com/farewell-farewell/p/5185341.html