Lingo Pirata (or Rövarspråket in Swedish) is a language only spoken by the Swedish pirates (unfortunately, an endangered race). The Lingo Pirata rules are very easy: take a word in common language, duplicate all the consonants, and put a lowercase “o” in the middle. For instance, “grog” is “gogrorogog” in Lingo Pirata, because each “g” turns into “gog” and “r” turns into “ror”. In the same way, “Pirate Lingo” turns into “PoPiroratote LoLinongogo”. Write an algorithm that translates a text to Lingo Pirata.
The input contains a sentence per line, that must be translated to
Lingo Pirata. The sentence may contain lowercase, uppercase letters,
spaces and punctuation symbols, although some test data will only
contain lowercase letters and spaces. In any case will appear any
character that do not belong to the ASCII table, as “ñ” or accentuated
letters. The end of the input is indicated with the string
end.
Remember that in C++ you can read a line of the input using the
instruction getline(cin, s), where
s has to be a variable of type
string.
For each line of the input (excepting the last one), your program must print a line with the translation of the sentence to Lingo Pirata. Remember that your program must respect the spaces, as it is explained in the instances.
(50 points) Some test data will only contain sentences with spaces and lowercase letters, as the one in the instance 1.
(50 points) Other test data will contain cases of every type, as the ones in the instance 2.
Author: Anders Jonsson
Input
grog
pirate lingo
ship ahoi
end
Output
gogrorogog
popiroratote lolinongogo
soshohipop ahohoi
Input
...Ship ahoi!!! --Prepare to be boarded, by Jupiter. end
Output
...SoShohipop ahohoi!!! --PoProrepoparore toto bobe boboarordodedod, bobyoy JoJupopitoteror.