| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1146 人关注过本帖
标题:[求助]Fmt
只看楼主 加入收藏
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
 问题点数:0 回复次数:9 
[求助]Fmt

Fmt

Unix 的 fmt 程序可以对文本中的段落进行重排,保证每一行不超过 72 个字符。重排时它会遵守以下规则:

  • 新的一行可以从任何一个有空格的地方开始。如果开始一个新行,则在上一行的末尾和新行的开始都不应该有任何空格。
  • 在输出时,可以删除段落中的换行。文章的段落是通过一个空白行来划分的。
  • 在行尾不应该有任何空格。
  • 如果在一长串的字符间没有空格,且其长度超过了 72 个字符,则应该把它们放在一个单独的行上。

Sample Input

   Unix fmt
The unix fmt program reads lines of text, combining
and breaking lines so as to create an
output file with lines as close to without exceeding
72 characters long as possible. The rules for combining and breaking
lines are as follows.

1. A new line may be started anywhere there is a space in the input.
If a new line is started, there will be no trailing blanks at the
end of the previous line or at the beginning of the new line.

2. A line break in the input may be eliminated in the output, provided
it is not followed by a space or another line break. If a line
break is eliminated, it is replaced by a space.

Sample Output

   Unix fmt

The unix fmt program reads lines of text, combining and breaking lines
so as to create an output file with lines as close to without exceeding
72 characters long as possible. The rules for combining and breaking
lines are as follows.

1. A new line may be started anywhere there is a space in the input.
If a new line is started, there will be no trailing blanks at the end of
the previous line or at the beginning of the new line.

2. A line break in the input may be eliminated in the output,
provided it is not followed by a space or another line break. If a line
break is eliminated, it is replaced by a space.

Source

Miguel Revilla 2002-06-15

[此贴子已经被作者于2006-12-10 12:33:32编辑过]

搜索更多相关主题的帖子: Fmt DIV align left 空格 
2006-12-10 12:30
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 

输入输出时每段之间要空一行

2006-12-10 12:36
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 
呼唤高手
2006-12-10 17:15
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 

继续呼唤

2006-12-11 13:44
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 
的确很难啊
2006-12-11 19:37
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 
求助
2006-12-12 12:13
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 
大家加油
2006-12-13 17:23
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 
加油
2006-12-15 13:10
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 
求助
2006-12-16 09:47
yelo20053533
Rank: 1
等 级:新手上路
帖 子:161
专家分:0
注 册:2006-11-27
收藏
得分:0 
难啊
2006-12-17 15:02
快速回复:[求助]Fmt
数据加载中...
 
   



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

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