DWITE '10 R4 #1 - Future Printer

View as PDF

Submit solution

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

Problem type
DWITE Online Computer Programming Contest, January 2011, Problem 1

Welcome to the future. Everyone has received their complimentary 3D printer and physical objects are trivially created… if you can describe those objects well enough, which does take some time. Being the go-to-computer-person for your entire extended family there have been too many of such requests. Let's automate some of this work. Triangles are a common base shape in many designs, and we want a particular type of such in various sizes.

The input will contain 5 lines, integers 1 \le N \le 25, the height of the triangle.

The output will contain 5 ASCII drawings of the triangles, in corresponding heights. The shape of a triangle is something as follows:

..*..
..*..
.***.
.***.
*****

Note: all the lines in each test case are equally wide; equal to the width of the base of the triangle.

Sample Input

1
2
3

Sample Output

*
*
*
.*.
.*.
***

Problem Resource: DWITE

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Comments

There are no comments at the moment.