// this version uses get function with a parameter and just checks operation #include using namespace std; int main() { int numLines = 0; char c; while (cin.get(c)) { if (c == '\n') numLines++; } cout << "There were " << numLines << endl; return 0; }