Domanda di colloquio di Microsoft

Tradition String Manipulation Question. But you need to use C++.