Pregunta de entrevista de Fluentgrid

To solve some puzzles,write some pseudo codes