题目:http://acm.hdu.edu.cn/showproblem.php?pid=2085
#include <iostream>
using namespace std;
int main()
{
long long int high[34];
long long int low[34];
high[0]=1;
low[0]=0;
for(int i=1; i<34; i++)
{
high[i]=3*high[i-1] + 2*low[i-1];
low[i]=1*high[i-1] + 1*low[i-1];
}
int n;
while(cin>>n && n!=-1)
{
cout<<high[n]<<", "<<low[n]<<endl;
}
return 0;
}