Simple console c++ from online book