Flat peach kee AC hangzhou Electric

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.