Add Problem 10 c++ solution