Read from standard input a single line containing integers
separated by commas (single-line CSV format). Determine and
print:
1. the number of numeric values on the line;
2. their sum.
The two numbers are printed on a single line, separated by a
space. If the line contains no numeric values, print
0 0.
Spaces between commas and numbers are ignored. Numbers can be
positive or negative (with + or - prefix).
The data are read from standard input (in the format described), not from a
file. Use cin.getline to read the complete line.
Input:
The program reads a single line of at most 4000 characters,
containing integers separated by commas.
- the line length is between 0 and 4000 characters
- numbers are integers between -1.000.000 and 1.000.000
- at most 1000 values per line
Output:
The program prints to standard output two integers, separated by a
space: the count of values and their sum.
Example:
Input:
1,2,3,4,5
Output:
5 15