#include using namespace std; void CountChars(); //int count = 0; // Supposed to count input lines char ch; // Hold one input character int main() { int count = 0; cin.get(ch); while(cin) { count++; CountChars(); cin.get(ch); //cout << ch << " is the current character." << endl; } cout << count << " lines of input processed." << endl; return 0; } void CountChars() // Counts the number of characters on one input line // and prints the count Note: main() has already // read the first character on a line { int count = 0; while (ch != '\n') { count++; cin.get(ch); } cout << count << " characters on this line." << endl; }