#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;
}
5.9
最新推荐文章于 2024-10-26 14:39:02 发布