Add Problem 7 c++ solution