Eakspay igpay atinlay?
InterviewTime limit1sMemory limit256 MB
Translate each phrase into Pig Latin by moving each leading consonant cluster to the end with ay, or adding yay after vowel-initial words.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Pig Latin rewrites an English word with two rules.
First, if the word begins with a consonant or a cluster of consonants, cut that whole leading cluster off, attach it to the end of the word, and add "ay". Second, if the word begins with a vowel, leave the word alone and add "yay" to the end.
The letter y counts as a vowel in this problem. So "yellow" begins with a vowel, and "my" begins with the single consonant m and becomes "ymay".
Every word consists of lowercase English letters only and contains at least one vowel. Words inside a phrase are separated by one space, and a phrase is at most 200 characters long.
Input
The first line contains the number of phrases . ()
Each of the next lines contains one phrase.
Output
Print lines. Line holds phrase translated into Pig Latin. Keep the words in their original order and separate them with one space.