Solve problem 97 using C++.