#include void main() { using namespace std; char line[80]; int count = 0; cout << "Enter characters then press Ctrl+z when done:\n"; while (cin.getline(line,80)) { cout << "text: " << line << endl; count++; } cout << "done\n"; cout << "You entered " << count << " characters.\n"; } /* Enter characters then press Ctrl+z when done: a text: a b text: b c text: c abc text: abc a b c text: a b c 123 text: 123 1 2 3 text: 1 2 3 ^Z done You entered 7 characters. Press any key to continue . . . */