Problem H
Pig Latin
Ancay youyay eakspay igpay atinlay? (Can you speak pig latin?) If you can’t, here are the rules:
-
If a word begins with a consonant, take all of the letters before the first vowel and move them to the end of the word, then add ay to the end of the word. Examples: pig
igpay, there erethay. -
If a word begins with a vowel (a, e, i, o, u, or y), simply add yay to the end of the word. For this problem, y is always a vowel. Examples: and
andyay, ordinary ordinaryyay.
Although there are many variants of Pig Latin (such as Kedelkloppersprook in Germany), for this problem we will always use the rules described above.
A friend of yours was frustrated with everyone writing in Pig Latin and has asked you to write a program to translate to Pig Latin for him. Ouldway youyay ebay osay indkay otay oday ityay? (Would you be so kind to do it?)
Input
Input consists of
Output
Your program should output the text translated to Pig Latin using the rules described above.
Sample Input 1 | Sample Output 1 |
---|---|
i cant speak pig latin |
iyay antcay eakspay igpay atinlay |
Sample Input 2 | Sample Output 2 |
---|---|
the quick brown fox jumps over the lazy dog and ordinary foxes dont jump over lazy dogs |
ethay uickqay ownbray oxfay umpsjay overyay ethay azylay ogday andyay ordinaryyay oxesfay ontday umpjay overyay azylay ogsday |