杭电acm2042
http://acm.hdu.edu.cn/showproblem.php?pid=2042
简单的从后面往前递推
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include<stdio.h> 2 int pro(int a) 3 { 4 int l=3,i; 5 for(i=0;i<a;i++) 6 l=(l-1)*2; 7 return l; 8 } 9 int main() 10 { 11 int n,i,a; 12 scanf("%d",&n); 13 while(n--) 14 { 15 scanf("%d",&a); 16 printf("%d\n",pro(a)); 17 } 18 return 0; 19 }