Home > Back-end >  ZCMU 1320 cultivars
ZCMU 1320 cultivars

Time:12-20

The Description
Like journey to the west of the students must have know the story of the wu is empty to steal to eat flat peach, you always feel this monkey is too quiet, in fact you is to know: the wu is empty is a math problem in the study!
What's the problem? He studied problem is flat peach how many!
However, in the end, he still failed to solve this problem, hehe ^ - ^
The situation is this:
On the first day of the wu is empty to eat the peach, the total number of more than half a day and the rest of the peaches to eat more than half a, after eating the rest of the more than half a day, every day to n days ready to eat only a peach, clever you, the wu is empty, please see, when he was on the first day began to eat the peach has a total of how many?

Input
How much input data set, a line, each group contains a positive integer n (1
The Output
For each group of input data, output the total number of the first day began to eat the peach, a line for each test instance,



The Sample Input
2
4
The Sample Output
4
22
Code:
#include
using namespace std;
Int main ()
{
int n;
While (~ the scanf (" % d ", & amp; N))
{
Int s=1;
for(int i=1; i<=n - 1; I++)
{
S=(s + 1) * 2;
}
Printf (" % d \ n ", s);
}
return 0;
}
  • Related