Pregunta de entrevista de Honeywell

Solve an algorithm using whichever programming language ( C or C++ in this case)