Skip the Header Line
mediumQuestion 592The first line of the file is a text header that must be skipped; every line after it holds integers separated by spaces or newlines:
scores 20 25 30
Write a function int sumAfterHeader(const string& filename) that returns the sum of all the numbers after the header. The header may contain spaces, for example daily totals.
The test prints the returned sum on its own line, for example (see Expected Output).
Do NOT write a main function.
Expected output
75 14
= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Streamsifstream
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.