请问这个问题要怎么编?
You are given a file containing an unknown amount of numbers. Each numberis one of the numbers 1 to 9. A number can appear zero or more times and can
appear anywhere in the file. The number 0 indicates the end of the data. Some
sample data are:
5 3 7 7 7 4 3 3 2 2 2 6 7 4 7 7
2 2 9 6 6 6 6 6 8 5 5 3 7 9 9 9 0
Write a program to read the data once and print the number that appears the most in
consecutive positions and the number of times it appears. Ignore the possibility of a tie.
For the above data, output should be 6 5.
试了很多次都不对