DWITE Online Computer Programming Contest
March 2010
Problem 1
ASCII bar graphs
The input file DATA1.txt will contain 5 lines, integers -5 <= N <= 5
The output file OUT1.txt 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:
*****|----- -****|----- -----|----- -----|*---- -----|***--