Lockheed Martin Interview Question

Use C++ to solve a given problem.