码迷,mamicode.com
首页 > 其他好文 > 详细

hdu2013

时间:2015-05-11 21:45:17      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

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 }

 

hdu2013

标签:

原文地址:http://www.cnblogs.com/xuesen1995/p/4495478.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!