#include <iostream>
#include <vector>
using namespace std;
int main()
{
int cur = 1, max = 0;
string str, maxStr = "", curStr = "";
vector<string> st;
while (cin >> str) {
st.push_back(str);
}
auto beg = st.begin();
while (beg != st.end()) {
if (*beg == curStr) {
++cur;
cout << 111 << endl;
} else {
cur = 1;
curStr = *beg;
}
if (cur > max) {
max = cur;
maxStr = curStr;
}
++beg;
}
cout << "maxStr: " + maxStr << " " << max << endl;
return 0;
}
c++ primer 练习5.14
最新推荐文章于 2022-07-31 11:57:29 发布