Back/Print and Input: Array Total

Print and Input: Array Total

EasyLevel: 1Topic: Programming Basics
XP Reward:+50 XPCoin Reward:+5 Coins

You are given a list of integers. Your task is to compute the total sum of all values in the list.

This problem is part of Programming Basics practice and is designed to strengthen the Print and Input pattern.

Input Format

  • The first line contains an integer n, the number of values.
  • The second line contains n space-separated integers.

Output Format

Return one integer: the sum of the given values.

Example 1

Input:

6
-29 -17 -5 7 19 31

Output:

6

Explanation:

  • The values are -29, -17, -5, 7, 19, 31.
  • Adding them gives 6.

Constraints

  • 1 <= n <= 10^5
  • -10^9 <= value <= 10^9

Return Requirement

Implement the starter function for this Easy problem. Read from the raw input string and return only the required answer, with no labels or debug text.

Judge Behavior

Run Code checks the visible sample cases. Submit checks those samples plus additional hidden cases that follow the same input format and constraints.

Loading editor...
Input
6
-29 -17 -5 7 19 31
Expected Output
6