For the symbol triangle problem, there are n symbols in the first row of the symbol triangle. The symbol can be \"+\" or \"-\". The symbols of each of the following rows are obtained from the previous row. There are \"+\" under 2 symbols of the same sign and \"-\" under 2 symbols of different signs. As shown in the figure below (one of the symbol triangles with 4 symbols in the first row): The symbol triangle problem requires that for a given n, calculate how many different symbol triangles there are so that the number of \"+\" and \"-\" they contain is the same. Input The input contains several test cases. For each test case, one line of input is an integer n (2<=n<=20), which represents the number of symbols in the first row of the symbol triangle. When the input n is 0, it indicates the end of input. Output For each test case, the output includes a line. This line contains only one integer, which is the total number of different symbol triangles in the test case so that the number of \"+\" and \"-\" they contain is the same. Sample Input 230Sample Output 04
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore