您的位置:首页 > 其它

定义附加项

2016-02-20 20:29 429 查看
#include <iostream>
#include <string>

using namespace std;

int main ()
{
string k1,k2;
cout << "Enter some words:(Ctrl + I to end)" << endl;
while(cin >> k1)
{
#ifndef NDEBUG
cout << endl << "调试:" << k1 << endl;  // 这是调试用的,
#endif
if( !isapper(k1[0]))
continue;
if(k1 == k2)
break;
else
k2 = k1;
}
if(k1 == k2 && !k1.empty())
cout << "The repeated word:" << k1 << endl;
else
cout << "没有重复的!" << endl;

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: