Problem 011, C++