Peach in mind
Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 41117 Accepted Submission (s): 30915
Problem Description
Like the journey of the students must know that Wu empty eat peach story, you must all think this monkey too noisy, in fact you are some do not know: Goku is a mathematical problem in the study!
What's the problem? The question he studied was how many peaches there were!
However, in the end, he still failed to solve the problem, hehe-^
That was the case:
The first day Goku ate more than half of the peaches, the next day, the rest of the peaches eaten more than half one, the next day to eat the rest of the last half of one, to the nth day when ready to eat only a peach left. Smart you, please help Goku to calculate the first day he began to eat when the peach a total of how many?
Input
There are several groups of input data, one row for each group, and a positive integer n (1<n<30), indicating that only one peach is left on the nth day.
Output
For each set of input data, the total number of peaches to start eating on the first day of the output, one row per test instance.
Sample Input
2
4
Sample Output
4
22
Author
Lcy
Source
C Language Programming exercises (II.)
#include <stdio.h>
int main ()
{
int i,j,c;
while (scanf ("%d", &i)!=eof)
{
C=1;
for (j=1;j<i;j++)
{
c= (c+1) * *;
}
printf ("%d\n", c);
}
}
Flat peach kee ac hangzhou Electric