Problem C
InterviewTime limit1sMemory limit2048 MB
Given N words, replace each c with k or s by its English pronunciation rule, and replace each ch with c.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
The English language is notorious for its inconsistent spelling system. This problem focuses on the letter c. The letter c can be pronounced in several ways, which can confuse learners. Still, a few simple patterns help speakers choose the right pronunciation.
- It is pronounced as ⟨k⟩ if it is followed by
a,o, oru, if it is followed by a consonant letter other thanhandy, or if it is at the end of a word. Consonant letters are the English letters other than the vowel lettersa,e,i,o, andu. - It is pronounced as ⟨s⟩ if it is followed by
e,i, ory. - The adjacent pair
chhas a unique sound ⟨c⟩.
You are given words . For each word, replace every c with k or s according to the patterns above, and replace every ch with c.
Input
The first line contains an integer (). Each of the next lines contains a string . consists of only lowercase English letters, and its length is between 1 and 100.
Output
For each word, output one line containing the simplified spelling of under the patterns above.