| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 761 人关注过本帖
标题:大侠门,帮虾米做个题,好吗?
取消只看楼主 加入收藏
虾米1号
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-2-29
收藏
 问题点数:0 回复次数: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| |
-------
搜索更多相关主题的帖子: 虾米 
2008-03-02 13:02
快速回复:大侠门,帮虾米做个题,好吗?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019368 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved