汉诺塔系列1
http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2064&cid=1158
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<stdio.h> long long f(int n) { if(n==0) return 1 ; else return 3*f(n-1); } int main() { int n, t ; scanf("%d", &t) ; while(t--) { scanf("%d", &n) ; printf("%lld\n", f(n)) ; } }