Visual C++ Solution