http://www.perlmonks.org?node_id=3669


in reply to Pig Latin

TIMTOWTDI
*grin*
tr/a-zA-Z/ /cs; split; foreach $_ (@_){ /^[aeiou]\S*/ ? $_ .="way " : s/(\S)(\S*)/$2$1ay /; print; }
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.
---
Crulx
crulx@iaxs.net