Question: Write a C++ program that reads in lines of text from the standard input. Keep a count of the number of lines that you read.

 Write a C++ program that reads in lines of text from

Write a C++ program that reads in lines of text from the standard input. Keep a count of the number of lines that you read. Keep track of the length of the longest line. Keep count of the number of integers in the input. Remember to check for errors before counting something as an integer. For example, 17 is an integer but 17.4 is not. When there is no more input, print out three lines of output, as follows: NUMBER OF LINES: n1 LENGTH OF LONGEST LINE: n2 NUMBER OF INTEGERS: n3 ... where n1, n2, n3 are the counts your program kept when processing input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!