Pregunta de entrevista de think-cell

Solve a task using C++ standard library.