题目地址:http://ac.jobdu.com/problem.php?cid=1040&pid=87
另地址:http://acmclub.com/problem.php?id=1151
//九度OJ 教程88 递归解决之汉诺塔III
//http://ac.jobdu.com/problem.php?cid=1040&pid=87
#include<stdio.h>
int main()
{
long long n,i,s[36];
s[1]=2;
for(i=2;i<36;i++)s[i]=3*s[i-1]+2;
while(~scanf("%lld",&n))printf("%lld\n",s[n]);
return 0;
}