C++ Coded Program (CodeNation Hacker Solution)