/* This program uses getline() to read lines of text, and print their line numbers and size. */ #include #include using namespace std; int main() { string s; int ln; ln = 0; while (getline(cin, s)) { ln++; printf("Line %2d - %s\n", ln, s.c_str()); } return 0; }