Solve problem 33 using C++.