文件名称:Text-Justification
-
所属分类:
- 标签属性:
- 上传时间:2016-03-27
-
文件大小:650byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
给定一组单词和长度,格式文本,每一行有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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.