Problem 006, C++