Write a C++ program that reads a file named words.txt and counts and prints the total number of words, the total number of VISIBLE characters (with white spaces), the total number of VISIBLE characters (without white spaces), the number of white spaces, and the number of lines in the file.
I/O
Program Input:
One text file called "words.txt"
Program Output:
Multiple lines showing the total number of words, the total number of characters (with white spaces), the total number of characters (without white spaces), the number of white spaces, and the number of lines in the file. THIS PART HAS BEEN ALREADY WRITTEN FOR YOU.
Sample Testcase 0: (To try on your computer, it won't be graded, there is another secret text).
Input:
Suppose words.txt has the following passage:
Arithmetic operators in C++ have the same precedence as they do in mathematics.
Multiplication and division have left associativity (meaning that they will be evaluated from left to right) and they have higher precedence than addition and subtraction, which also have left associativity.
We can also force the precedence of expression using parentheses. Just the same way as you would do that in normal mathematics.