HDU-2013

猴子吃桃子问题。

 1 #include<stdio.h>
 2 #include<stdlib.h>
 3 #include<math.h>
 4 #include<string.h>
 5 int main()
 6 {
 7     int n;
 8     int s;
 9     while (scanf("%d",&n)!=EOF)
10     {
11         s=1;
12         n--;
13         while (n--)
14         {
15             s=2*(s+1);
16         }
17         printf("%d
",s);
18     }
19     return 0;
20 }
原文地址:https://www.cnblogs.com/leiyuxiang/p/3489839.html