1212. Extra Krunch

时间限制 1000 ms   内存限制 30 MB

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.
   ·  ·   ·    ·   ·   ·    ·   ·  ·    ·  ·   ·   ·  ·     ·        \n

样例输出

复制
NW S TH M FR L GD C Y.
  · ·  · ·  · ·  · ·  \n

提交

请先 登录

Source

USACO 2002 February

© 2024 FAQs Contact About