Problem 009, C++