#include #include using namespace std; // count words in the standard input stream, cin int main() { string word; int numWords = 0; // initially, no words bool b = cin >> word; return b; return int(cin >> word); while (b) // read succeeded { numWords++; b = cin >> word; } cout << "number of words read = " << numWords << endl; system("Pause"); return 0; }