coder52 / Cpp-Primer-Solutions-2013

MIT License
0 stars 0 forks source link

Page 185 Exercise 5.14: #20

Closed coder52 closed 3 years ago

coder52 commented 3 years ago

Write a program to read strings from standard input looking for duplicated words. The program should find places in the input where one word is followed immediately by itself. Keep track of the largest number of times a single repetition occurs and which word is repeated. Print the maximum number of duplicates, or else print a message saying that no word was repeated. For example, if the input is how now now now brown cow cow the output should indicate that the word now occurred three times.