# include # include using namespace std; int main ( ) // // CHARACTER_COUNT allows the user to type some input, // and returns the number of characters read. // // Multiple lines of input are allowed. // // Input is terminated by the EOF (CTRL-D) character entered on a new line. // { char c; int n = 0; cout << "Enter any textual input.\n"; cout << "Multiple lines are OK.\n"; cout << "Terminate with EOF (CTRL-D) on a new line\n"; while ( true ) { cin >> c; if ( cin.eof ( ) ) { break; } n = n + 1; } cout << "\n"; cout << "Your input consisted of " << n << " characters.\n"; return 0; }