Skip to content

Instantly share code, notes, and snippets.

@2hanX
Last active June 18, 2020 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2hanX/cd15a0c2ab9733bee99ef6bb5f4b7a80 to your computer and use it in GitHub Desktop.
Save 2hanX/cd15a0c2ab9733bee99ef6bb5f4b7a80 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char word[12];
int sum = 0;
cout << "Enter words(to stop, type the word done): \n";
cin >> word;
while (strcmp(word,"done"))
{
sum += 1;
cin >> word;
}
cout << " You entered a total of " << sum << " words" << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment