How do I use the fast IO if I want to read an unknowb number of integers and show the biggest one on screen?

I do know how to use the fast IO if I have to only read one number, but I am lost when it comes to everything else. My actual code is as follows:

http://rextester.com/MHUJ99891

However, once I try to apply this to more integers, the program doesn’t work at all:

http://rextester.com/TYQ84727

I don’t get what’s the problem with the second code

I think

 ios::sync_with_stdio(false);
 cin.tie(NULL);

would work. Add these line in main function.

^Nope. No change whatosever.

Pls provide problem link

https://www.pbinfo.ro/?pagina=probleme&id=2081
Translation: Read numbers from a file until there are no more left. Output the biggest one out of them