[2023 OUCC Round 1] Stop at Zero
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
A program is required to output a simple horizontal graph. Data is sent to the program as a stream of integers. Each new integer is less than the previous one. The graphical output is only required for the positive data.
The formatting of the graph consists of a number of dashes on each horizontal line corresponding to the integer being represented on that line of the graph.
Task:
Write a program that takes, as input, an unspecified number of integer inputs and outputs a horizontal line graph of the data received that is greater than 0.
Constraints:
[Note: you do not need to check constraints in your code for this task - they are just for information about the range of test data values.]
- All integers in the input will be no more than 100.
- The data supplied will always have at least one integer that is greater than 0.
- The data supplied will always have at least one integer that is less than 1.
Input format:
- An unspecified number of rows with a single integer in each row.
Output format:
- A horizontal line graph.
Example:
7
5
2
1
0
-2
-12
-------
-----
--
-