✕
ArraysCoding problems
Arrays: coding problems
Write a program that reads the input and prints the answer. Run checks it against every test, including hidden ones.
0 of 7 solved
A pedometer log lists one number per day. Print two numbers: the total of all days, then the largest value in the list. The two numbers are separated by one space. The list always has at least one value.
Input. The first line holds n (1 to 100). The second line holds n integers separated by spaces. Each value is between -1000 and 1000.
Output. One line with the total and the largest value, separated by one space.
Example 1 input
5 3 9 -2 7 4
Output
21 9
Example 2 input
4 -4 -8 -1 -6
Output
-19 -1