您的位置:首页 > 编程语言 > C语言/C++

C++ Primer【练习】【5.20】

2015-10-08 16:49 369 查看
#include <iostream>#include <stdlib.h>#include <vector>#include <string>using std::cin;using std::cout;using std::endl;using std::vector;using std::string;int main(){string buf,mark;cin >> mark;int count = 0;while (cin >> buf)//&&!buf.empty()){if (mark == buf){count++;cout << buf << endl;break;}mark = buf;}if (count==0)cout << "There is no same words!" << endl;system("pause");}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: