当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2881:Wiping Words

题目描述
In this problem, you are given a paragraph of text in terms of a sequence of lines. Each lines contains a number of words which are sequences of lowercase and uppercase letters and are separated by either blank characters or asterisks. A word is wiped out if for each character in that word, there is no letter or asterisk character in the same position in the next line, or the word appears in the last line of the input. If such a case happens, all occurrences of that word in the text is converted to blanks independent of the corresponding characters in the next line. Note that the asterisks and black characters never disappear. Also, note that the words are considered case-sensitive. Write a program to read a sequence of lines described above and wipe out as many word as it can iteratively.
输入解释
The first line of the input contains a single integer t (1 ≤ t ≤ 20) which is the number of test cases in the input. Each test case contains a sequence of lines containing characters A..Z, a..z, blank and asterisk (*). After each test case, there is a line containing single hash character (#) which is not a part of the lines you must consider in your algorithm.
输出解释
For each test case, write the input lines in the output with the wiped out words converted to blanks. Separate outputs for consecutive test cases with lines containing a single hash character.
输入样例
2
ACM is
**
#
in this world
you are in*side
the world
*
#
输出样例
ACM   
**
#
             
you       *    
the      
*
#

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Tehran 2004

源链接: POJ-2881

最后修改于 2020-10-29T06:46:39+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536