Solve problem 62 using C++.