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

建议使用的浏览器:

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

1951:Extra Krunch

题目描述
A krunched word has no vowels ("A", "E", "I", "O", and "U") and no repeated letters. Removing vowels and letters that appear twice or more from MISSISSIPPI yields MSP. In a krunched word, a letter appears only once, the first time it would appear in the unkrunched word. Vowels never appear.

Krunched phrases similarly have no vowels and no repeated letters. Consider this phrase:
        RAILROAD CROSSING

and its krunched version:
        RLD CSNG

Blanks are krunched differently. Blanks are removed so that a krunched phrase has no blanks on its beginning or end, never has two blanks in a row, and has no blanks before punctuation. Otherwise, blanks not removed. If we represent blanks by "_",
        MADAM_I_SAY_I_AM_ADAM__

krunches to:
        MD_SY

where the single remaining blank is shown by "_".

Write a program that reads a line of input (whose length ranges from 2 to 70 characters), and krunches it. Put the krunched word or phrase in the output file. The input line has only capital letters, blanks, and the standard punctuation marks: period, comma, and question mark.
输入解释
A single line to be krunched.
输出解释
A single krunched line that follows the rules above.
输入样例
NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THEIR COUNTRY.
输出样例
NW S TH M FR L GD C Y.

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

题目来源 USACO 2002 February

源链接: POJ-1951

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

共提交 0

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