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\n",x);
18     }
19     return 0;
20 }

 

posted @ 2015-05-11 20:12  煎饼馃子  阅读(221)  评论(0编辑  收藏  举报