Add Problem 12 c++ solution