Problems

Array Sum

EasyArrays

Write a program that reads an array of integers from stdin, one integer per line, and outputs the sum of the integers. The input will contain at least one integer and at most 100 integers. Each integer will be between 1 and 100.

Example 1

Input: 5 15 20 8

Output: 48

The sum of the integers 5, 15, 20, and 8 is 48.

Constraints

  • 1 <= n <= 100
  • 1 <= integers <= 100

Hints

arraysum
Array Sum | CodeForge AI