DWITE Online Computer Programming Contest

Future Printer

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 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 file DATA1.txt will contain 5 lines, integers 1 ≤ N ≤ 25, describing the height of the triangle.

The output file OUT1.txt will contain 5 ASCII drawings of the triangles with 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 (first 3 shown):
1
2
3
Sample Output (first 3 shown):
*
*
*
.*.
.*.
***