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