rev words cpp