#C6562. Array Sum Challenge
Array Sum Challenge
Array Sum Challenge
You are given T test cases. Each test case consists of a single line of space-separated integers representing an array. Your task is to compute the sum of elements of each array.
In some test cases, the array can be empty. In such cases, the sum is defined to be 0.
Note: The input is read from stdin
and the output should be printed to stdout
. Each test case’s result must be printed on a separate line.
inputFormat
The first line contains an integer (T) representing the number of test cases. Each of the following (T) lines contains space-separated integers which represent an array. A blank line indicates an empty array.
outputFormat
Output (T) lines, where each line is the sum of the corresponding array provided in the input.## sample
1
1 2 3 4 5
15
</p>