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

5.9

2016-03-03 11:21 316 查看
#define  _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include<string>
using namespace std;
int main()
{
string test;
cout << "Enter words (to stop ,type the word done)" << endl;
int counts = 0;
do{
cin>>test;
if (strcmp(test.c_str(), "done") == 0)
break;
else
counts++;
} while (true);
cout << "You entered a total of " << counts << " words" << endl;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++