一个关于分栏的问题 ( 积分: 200 )

  • 主题发起人 netameng
  • 开始时间
N

netameng

Unregistered / Unconfirmed
GUEST, unregistred user!
已经很久没有做程序,提一个简单的问题吧,就当散分好了:

提供一个原始文档,要求设置分栏数、宽度,将此原始文档自动按要求格式保存为分栏后的TXT文本。

比如:
1234567890123456789012345678901234567890123456789012345678901234567890

要求设置为三栏,每栏宽度为20,那么保存效果就应该是
12345678901234567890 12345678901234567890 12345678901234567890
12345678901234567890

保存后的文件阅读习惯应满足:
1、按列阅读,即先按顺序读完第一列后,再从第二列第一行开始读起,依次类推
2、每列高度应一致,不能相差超过一行
3、算法尽可能优化
4、如果是纯英文行,则按两端对齐方式排版。英文单词不得断行。

效果示例(无实际意义,仅供参考):

that are portable across The result of this effort is a
virtually all UNIX set of libraries, headers, and
platforms.[1] To enhance reuse utilities that we collectively
of these tools and libraries, refer to as UWIN. UWIN
we want to make them available contains nearly all the X/Open
on systems running Windows Release 4[4] headers,
NT[2] and/or Windows 95[3]. We interfaces and commands. We
did not want to support discuss alternative porting
multiple versions of these strategies, commercial
libraries, and we wanted to products, design goals,
minimize the amount of problems that had to be
 
估计 一般人都不会,比如我
 

Similar threads

回复
0
查看
905
不得闲
S
回复
0
查看
675
SUNSTONE的Delphi笔记
S
顶部