Easy-to-Pronounce Words
InterviewTime limit1sMemory limit1024 MB
Given a lowercase word, print 1 if its vowels and consonants strictly alternate, and 0 otherwise.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
A word is easy-to-pronounce if every vowel in the word is immediately followed by a consonant, and every consonant is immediately followed by a vowel. The first letter can be a vowel or a consonant. The vowels are a, e, i, o, u. The letter y is not a vowel, so it counts as a consonant.
Given a word, print 1 if it is easy-to-pronounce, and 0 otherwise.
Input
There is one input line. It contains a word of 1 to 30 lowercase letters, starting in column 1. The input has no characters other than lowercase letters.
Output
Print 1 if the word is easy-to-pronounce, and 0 otherwise.