Update ex5_14.cpp

In the previous version, when you successively input same strings, then end the loop by ctrl+z(windows), the result is no duplicated words, which is not accord with our input.(eg. input three "123" and then ended with ctrl+z). 
The reason is that if the inputs are same from start, we will never enter the else branch where assign value to variable 'max_duplicated'.
So the operation on 'max_duplicated' should be done only when the 'count > max_duplicated.second + 1', which shows that continously duplicated inputs are tested. And when the input is not same with the previous, we should set the count for the new string to 1.