#include
<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
string i, temp_word, most_word;
int cnt1 = 1, cnt2 = 1;
cin >> temp_word;
most_word = temp_word;
`
while (cin >> i)
{
//输入0终止
if (i == "0")
break;
//记录当前连续出现单词的次数
if (i == temp_word)
{
cnt1++;
}
else {
temp_word = i;
cnt1 = 1;
}
//将出现次数最多的单词和次数保存下来
if (cnt1 > cnt2) {
most_word = i;
cnt2 = cnt1;
}
}
cout << "出现次数最多的单词是:"
<< most_word << " 一共出现了"
<< cnt2 << "次" << endl;
return 0;
}