DWITE '10 R4 #1 - Future Printer

View as PDF

Submit solution

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

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, January 2011, Problem 1

Welcome to the future. Everyone has received their complementary 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. Lets 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

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

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


Comments

There are no comments at the moment.