#include<iostream>
#include<cstring>
#define ArSize 50
using namespace std;
int main()
{
char word[ArSize];
int number = 0;
cout << "Enter words (to stop, type the word done):" << endl;
while(cin >> word && strcmp("done",word))
number++;
cout << "You entered a total of " << number << " words." << endl;
}
Exercise 5.7
最新推荐文章于 2022-05-06 22:28:47 发布