/**
* c++ primer 5.20
*
**/
#include <iostream>
#include <vector>
using namespace std;
int main()
{
string buf, mstr;
vector<string> str;
bool status = false;
while (cin >> buf && !status) {
for (auto i : str) {
if (i == buf) {
mstr = buf;
status = true;
break;
}
}
str.push_back(buf);
}
if (status) {
cout << "重复出现的单词是:" + mstr << endl;
} else {
cout << "没有任何单词是连续重复出现的" << endl;
}
return 0;
}
c++ primer 练习5.20
最新推荐文章于 2021-09-28 22:37:00 发布