DWITE '12 R1 #1 - Candy Piles

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, October 2012, Problem 1

After collecting a lot of candy this Halloween, the most obvious next step is to organize it into piles and draw graphs of the loot. Of course.

The input will contain 5 lines, each a single positive integer describing the height of candy piles.

The output will contain an ASCII drawing of the piles of candy. A triangle of asterisks will approximate such piles. Refer to the sample below.

Sample Input (first 3 shown)

2
1
3

Sample Output (first 3 shown)

*
**
*
*
*
**
***
**
*

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


Comments


  • -1
    EtharnAsano  commented on Sept. 29, 2019, 11:36 p.m.

    Why does the sample input only have 3 lines?