文件名称:Text-Justification
介绍说明--下载内容均来自于网络,请自行研究使用
给定一组单词和长度,格式文本,每一行有L人物和完全(左和右)合理的。 你应该包你的话在一个贪婪的方法,也就是说,包尽可能多的单词可以在每一行。垫额外空间“必要时,每一行有L字符。 单词之间额外的空格应该尽可能均匀分布。如果空间的数量在一个单词之间不匀,左边的空槽将分配更多的空间比右边的插槽。 最后一行文本,应该向左对齐,没有单词之间插入额外的空间。-Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.
You should pack your words in a greedy approach that is, pack as many words as you can in each line. Pad extra spaces when necessary so that each line has exactly L characters.
Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line do not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right.
For the last line of text, it should be left justified and no extra space is inserted between words.
You should pack your words in a greedy approach that is, pack as many words as you can in each line. Pad extra spaces when necessary so that each line has exactly L characters.
Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line do not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right.
For the last line of text, it should be left justified and no extra space is inserted between words.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Text Justification.CPP