2 人解决,10 人已尝试。
2 份提交通过,共有 22 份提交。
9.7 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
A snowflake of size 1 looks like this.
+
A snowflake of size 2 looks like this.
v
+<
^
Snowflakes of a larger size n are composed of a center (the ‘+’ character) and 4 branches, each a snowflake of size n-1, but each with only 3 branches. The branch closest to the center of the big snowflake is replaced by a string of hyphens (‘-‘) or pipes (‘|’), depending on whether it is horizontal or vertical. See the sample output for snowflakes of size 3 and 4. Your task is to write a program that can draw snowflakes.
The first line of input gives the number of cases, N. N test cases follow. Each one is an integer n on a line by itself.
1 ≤ N ≤ 10,1 ≤ n ≤ 7.
For each test case, print a line “Case #x:”, where x is the number of the test case, followed by the snowflake. Make sure that none of the output lines contains any trailing whitespace characters.
4 1 2 3 4
Case #1: + Case #2: v >+< ^ Case #3: v >+< v | v >+-+-+< ^ | ^ >+< ^ Case #4: v >+< v | v >+-+-+< v ^ | ^ v >+< | >+< v | | | v >+-+---+---+-+< ^ | | | ^ >+< | >+< ^ v | v ^ >+-+-+< ^ | ^ >+< ^
2 人解决,10 人已尝试。
2 份提交通过,共有 22 份提交。
9.7 EMB 奖励。