//为了方便,要包含的文件会不同,但我没有删
#include <iostream>
#include <string>
#include <vector>
#include <bitset>
#include <cstring> //和C语言的string.h其实是一个版本
#include <stdexcept> //或用 #include <exception> 都行
using std::bitset;
using std::vector;
using std::cin;
using std::endl;
using std::cout;
using std::string;
using std::overflow_error;
//#define NDEBUG
//---------------------------------------------------------------------------
int main()
{
string s,s1,str;
while(cin>>s)
{
//--------------以下代码和#define NDEBUG相关,有此句,以下代码不执行,无则执行
#ifndef NDEBUG
cout<<"输入的单词为"<<s<<endl;
#endif
//-----------------------------------------------------------------------
if(s==s1&&isupper(s[0]))
{
str=s;
break;
}
else
s1=s;
}
if(!str.empty ())
cout<<"重复的首字母大写的单词是:"<<str<<endl;
else
cout<<"没有重复的首字母大写单词"<<endl;
return 0;
}
/*
191页习题6.25,修改6.11程序,使其有条件输出运行时的输入单词信息
*/