posted 20 years ago
Without giving too much away, here's a general approach. You want two control numbers, one representing the value from the file, and another representing the next number in the sequence.
Read in the first number and convert it to an integer, saving the value twice, both as the file value and the sequence value. Then set up a loop where you compare the two values (which will be the same the first time through the loop). If they are the same, then read in the next value and increment the sequence number. If they are different, print out the sequence number and increment it, but don't read in a value from the file.
Keep looping until you run out of values.
I could have described this more cleanly in pseudo-code, but I didn't want to give too much away.
Try coding it, and when you run into something you can't solve post the code that you have and get further comments.