Pergunta de entrevista da empresa think-cell

Programming tasks via codepad, no stl is needed or allowed.