hdu2013

http://acm.hdu.edu.cn/showproblem.php?pid=2013

 1 #include<iostream>
 2 #include<stdio.h>
 3 #include<math.h>
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int n;
 9     while(cin>>n)
10     {
11         int sum=1,x;
12         for(int i=1;i<n;i++)
13         {
14             x=2*sum+2;
15             sum=x;
16         }
17         printf("%d
",x);
18     }
19     return 0;
20 }
原文地址:https://www.cnblogs.com/xuesen1995/p/4495478.html