#include #include "CPstring.h" // file: wordcount.cc // author: D. Ramm // date: 10/11/96 // input in while test // counting words int main() { int count = 0; string word; cout << "type in words; use ^D to quit" << endl; while (cin >> word) { count++; } cout << "word count was " << count << endl; return 0; } Sample output: type in words; use ^D to quite word count was 12