The problem
The program receives as input a sequence of non-negative integers, each number is written on a separate line. The sequence ends with the number 0, upon re