I have tested this program and it always displays the longest string(s). I also passed the display of multiple strings if multiple are longest, I am not sure how I can meet req 4 and not req 3. Below is the input (lines 1-5) and output (line 6) of the test another question was told to run:
qwe qwe
test1
test2
test3
test4
qwe qwe