Pergunta de entrevista da empresa Edifecs

Not so difficult, but write a multi-threaded program