Problem 013, C++