C++: Problem 1
C++: Problem 2