CF1008A.Romaji
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are "a", "o", "u", "i", and "e". Other letters are consonant.
In Berlanese, there has to be a vowel after every consonant, but there can be any letter after any vowel. The only exception is a consonant "n"; after this letter, there can be any letter (not only a vowel) or there can be no letter at all. For example, the words "harakiri", "yupie", "man", and "nbo" are Berlanese while the words "horse", "king", "my", and "nz" are not.
Help Vitya find out if a word s is Berlanese.
维佳刚刚开始学习贝尔兰语。已知贝尔兰语使用拉丁字母。元音字母为 "a"、"o"、"u"、"i" 和 "e",其余字母均为辅音。
在贝尔兰语中,每个辅音之后必须紧跟一个元音;但任意元音之后可以跟任意字母。唯一的例外是辅音 "n":在该字母之后,可以跟任意字母(不仅限于元音),也可以不跟任何字母。例如,单词 "harakiri"、"yupie"、"man" 和 "nbo" 是贝尔兰语单词,而 "horse"、"king"、"my" 和 "nz" 则不是。
请帮助维佳判断一个单词 s 是否为贝尔兰语单词。
输入格式
The first line of the input contains the string s consisting of ∣s∣ (1≤∣s∣≤100) lowercase Latin letters.
输入的第一行包含一个字符串 s,由 ∣s∣(1≤∣s∣≤100)个小写拉丁字母组成。
输出格式
Print "YES" (without quotes) if there is a vowel after every consonant except "n", otherwise print "NO".
You can print each letter in any case (upper or lower).
如果除字母 “n” 外,每个辅音字母后面都紧跟着一个元音字母,则输出 "YES"(不带引号),否则输出 "NO"。
你可以以任意大小写(大写或小写)输出每个字母。
输入输出样例
输入#1
sumimasen
输出#1
YES
输入#2
ninja
输出#2
YES
输入#3
codeforces
输出#3
NO
说明/提示
In the first and second samples, a vowel goes after each consonant except "n", so the word is Berlanese.
In the third sample, the consonant "c" goes after the consonant "r", and the consonant "s" stands on the end, so the word is not Berlanese.
在第一和第二个样例中,除字母 “n” 外,每个辅音后面都跟着一个元音,因此该单词是 Berlanese 单词。
在第三个样例中,辅音 “c” 出现在辅音 “r” 之后,且辅音 “s” 位于单词末尾,因此该单词不是 Berlanese 单词。
输入解题思路,AI测评打分。不知道怎么写?