您已被选择制作一个可以创建一些漂亮的ASCII 条形图的程序。这是输入格式:
[List of words (they can have spaces)] [an integer >= 0]
Bar 3
This is so cool 4
IDK-Why 6
输入将具有此格式的多行,每一行代表图形中的一个条。图的输出格式如下:
_ _ _ _
|_|_|_|_|
| | | |
| | | + [name of 4th bar]
| | + [name of 3rd bar]
| + [name of 2nd bar]
+ [name of 1st bar]
这里有些例子:
In:
Cool 4
Kool 6
Out:
_
| |
_| |
| | |
| | |
| | |
|_|_|
| |
| + Kool
+ Cool
In:
Graph 5
Bar 3
Out:
_
| |
| |_
| | |
| | |
|_|_|
| |
| + Bar
+ Graph
In:
Very 4
Large 5
Bar 3
Graph 5
Out:
_ _
_| | | |
| | |_| |
| | | | |
| | | | |
|_|_|_|_|
| | | |
| | | + Graph
| | + Bar
| + Large
+ Very
In:
Bars can be 0 0
Large-bars_are$nice2 6
average)(@#$ 3
neato 5
Out:
_
| | _
| | | |
| |_| |
| | | |
| | | |
_|_|_|_|
| | | |
| | | + neato
| | + average)(@#$
| + Large-bars_are$nice2
+ Bars can be 0
允许使用功能或完整程序。
1
整数是一位数字还是大于9?
—
edc65 '16
> 9是允许的,我只是没有举个例子,因为它太大了。
—
J Atkin
每行上可以有尾随空格吗?即使输出矩形?
—
Stewie Griffin
是的,允许使用尾随空格
—
J Atkin
回顾历史,@ Doorknob删除了它,不知道为什么...
—
J Atkin