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 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
Get step-by-step solutions from verified subject matter experts
