// this version uses get function with no parameter so must check the stream #include using namespace std; int main() { int numLines = 0; char c = cin.get(); while (cin) { if (c == '\n') numLines++; c = cin.get(); } cout << "There were " << numLines << endl; return 0; }