in reply to Pig Latin
This strips newlines and doesn't handle the "th" type cases but it is different than the ones posted above. Post your C++ answer as a point of comparison.tr/a-zA-Z/ /cs; split; foreach $_ (@_){ /^[aeiou]\S*/ ? $_ .="way " : s/(\S)(\S*)/$2$1ay /; print; }
|
---|