5.9

来源:互联网 发布:python的turtle库 编辑:程序博客网 时间:2024/04/30 14:25
#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;elsecounts++;} while (true);cout << "You entered a total of " << counts << " words" << endl;return 0;}

0 0