练习5.21
#include "stdafx.h"
#include<iostream>
#include<string>
#include<vector>
using namespace::std;
int main()
{
string begin_string,second_string;
int flag = 0;
while (cin>> begin_string )
{
if (begin_string == second_string && begin_string[0]<='Z'&& begin_string[0] >= 'A')
{
flag = 1;
cout << begin_string << endl;
break;
}
else
{
second_string = begin_string;
flag = 0;
}
}
if (!flag)
{
cout << "没有任何单词" << endl;
}
system("pause");
return 0;
}