Solved pb002, C++