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

建议使用的浏览器:

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

2658:Song

题目描述
A song consists of one or more verses, each verse consists of four lines, each line consists of one or more words separated by single blank character, and finally, each word consists of one or more letters (a - z, A - Z).

We define the last syllable of a word to be the sequence of letters from the last vowel (inclusively) to the end of the word. If a word has no vowel, then the last syllable is the word itself.

We say that two lines rhyme if they have same last syllables (ignoring the letter case). Verse may have perfect rhyme, even rhyme, cross rhyme, shell rhyme or there may be no rhyme at all (free rhyme).

Verse has a perfect rhyme if all lines in a verse mutually rhyme (a a a a).

If verse does not have a perfect rhyme then we say that it has:

Even rhyme: if the first and second line rhyme and also third and fourth line rhyme (a a b b).
Cross rhyme: if the first and third line rhyme and also second and fourth line rhyme (a b a b).
Shell rhyme: if the first and fourth line rhyme and also second and third line rhyme (a b b a).

Write a program that will determine the rhyme for each verse in a song.
输入解释
The first line of the input contains an integer N, the number of verses in the song, 1 <= N <= 5.

The following 4N lines of the input contain the lines of the song. Maximal length of each line is 50.
输出解释
Output should have N lines. For each verse in a song there should a single line containing one of the words 'perfect', 'even', 'cross', 'shell' or 'free' describing the rhyme in that verse.
输入样例
2
Tko je to
to je Zlo
nije Zlo
to je Mo
Gdje je Mu
jel na putu
Brijem da nije
vidlo bi se
输出样例
perfect
even

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

源链接: POJ-2658

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

共提交 0

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