3. Write a program that reads a sequence of positive integers and prints out their sum, except that if the
same number occurs several times consecutively, ignore all but the first. Assume an input of 0 marks
the end of the input. For example, if the input is 3 8 5 5 4 9 1 1 1 1 8 0 then you should print 38 (i.e.,
ignore one of the 5's and three of the 1's).
Could anyone help me out with this?