Added C++ source for Problem 3