DWITE '08 R1 #1 - LaNDscAPE ii

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
DWITE Online Computer Programming Contest, October 2008, Problem 1

A classic draw some ASCII patterns problem, turned onto its horizontal side. Let's draw some hills, of various heights.

The input will contain 5 lines, integers 0 \le N \le 5.

The output will contain 5 lines, the scene generated, as described below.

Background is drawn with .. Hills are triangles in shape, height specified by input, and are drawn with x. Refer to sample input.

Sample Input

1
2
3
0
4

Sample Output

.................
.............x...
......x.....xxx..
..x..xxx...xxxxx.
xxxxxxxxx.xxxxxxx

Problem Resource: DWITE

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Comments

There are no comments at the moment.