Last active
June 18, 2020 10:39
-
-
Save 2hanX/cd15a0c2ab9733bee99ef6bb5f4b7a80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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