当前位置: 代码迷 >> C语言 >> 大侠门,帮虾米做个题,好吗?
  详细解决方案

大侠门,帮虾米做个题,好吗?

热度:320   发布时间:2008-03-02 13:02:27.0
大侠门,帮虾米做个题,好吗?
CD TITLES
A keen photographer, I found my hard disk quickly filling up with snapshots and
videos. I decided to offload a lot of the files to CD. Each CD is in its own plastic
case, and the contents are clearly described on the front of the case. As the
number of CDs increased, I built myself a shelf on which the CDs stand vertically.
I need your help! I have written a title for each CD into a text file, but I need the
titles to appear vertically so that I can put them in the spine of the CD cases and
be able to read them easily from the shelf. I want you to write a program that will
output my titles vertically. I need lines between each title so that, when I print
them, I can easily cut along the lines.
I have worked out that I can fit 36 characters into the available space, so all
output titles must be 36 characters long, padded with spaces at the end where
necessary. If I accidentally make a title too long, only output the first 36
characters.
INPUT FORMAT
Input will be at most 50 titles, one to a line. Each title consists of 1 to 100 arbitrary
characters. A single ‘#’ on a line by itself indicates the end of input.
SAMPLE INPUT:
012345678901234567890123456789012345
David and Jane’s wedding, March 2002, Alexandria
Bahamas Holiday August 2001
#
OUTPUT FORMAT
Output will be the same titles presented vertically, where the left to right order will
be the same as the order of the input. There will be a column of bar (‘|’)
characters at each end, and separating each title, and a row of minus (‘-’)
characters (1 per column) at the beginning and end.
SAMPLE OUTPUT:
-------
|0|D|B|
|1|a|a|
|2|v|h|
|3|i|a|
|4|d|m|
|5| |a|
|6|a|s|
|7|n| |
|8|d|H|
|9| |o|
|0|J|l|
|1|a|i|
|2|n|d|
|3|e|a|
|4|’|y|
|5|s| |
|6| |A|
|7|w|u|
|8|e|g|
|9|d|u|
|0|d|s|
|1|i|t|
|2|n| |
|3|g|2|
|4|,|0|
|5| |0|
|6|M|1|
|7|a| |
|8|r| |
|9|c| |
|0|h| |
|1| | |
|2|2| |
|3|0| |
|4|0| |
|5|2| |
-------
搜索更多相关的解决方案: 虾米  

----------------解决方案--------------------------------------------------------
哎```几乎不回有帮你的```

因为我们不是英语狂人````
----------------解决方案--------------------------------------------------------
看不懂,呵呵~~~~
----------------解决方案--------------------------------------------------------
这个不是很难啊,就是把“横向”输入的内容“纵向”输出。
输出的规则已经说的很清楚了。
----------------解决方案--------------------------------------------------------
  相关解决方案