Since it's your homework, I won't do it..
But I'll give you some pseudo code..
Code:
Open file
while (file not empty)
read from file
counter increased
close file
while (counter not nill)
take current number
compare to next number
if (next greater)
hold next number as comparison
print what you holding variable contains
Or you might want to look at STL.