Solve problem 119 using C++.