DWITE '09 R5 #1 - ASCII bar graphs
View as PDFDWITE Online Computer Programming Contest, March 2010, Problem 1
The input will contain 5 lines, integers .
The output will plot the numbers as a graph. Each whole number gets an asterisk *; negative on the left of the central line drawn with pipes |, positive on the right. 0 does not get drawn. Empty spaces are filled with the minus sign - for alignment. See the sample graph for an example.
Sample Input
-5
-4
0
1
3
Sample Output
*****|-----
-****|-----
-----|-----
-----|*----
-----|***--
Problem Resource: DWITE
Comments