Solve problem 81 using C++.