CppPrimer_ex5_21
#include <iostream>
using namespace std;
int main() {
string s1,old;
while(cin>>s1) {
if (old==s1)
break;
else
old = s1;
}
if (s1 != old && cin.eof()) cout << "no repeated." << endl;
else cout << s1 << " occurs twice in succession." << endl;
return 0;
}INFO