Exercism c++ problem

Post #7 shows a less obscure approach.