5.5.2

来源:互联网 发布:常用排序算法包括 编辑:程序博客网 时间:2024/05/01 06:24
#include<iostream>#include<string>using namespace std;int main() {    string str, prestr;    bool twice = false;    while (cin >> str) {        if (isupper(str[0]) &&str == prestr) {            twice = true;            break;        }        else {            prestr = str;        }    }    if (!twice) {        cout << "没有单词重复" << endl;    }    else {        cout << str << endl;    }    return 0;}
0 0