Problems

Rest Parameter Sum

EasyES6+ Features

Read a single line of space-separated integers (any count) and print their sum. Use a rest-parameter style function sum(...nums).

Input: one line of integers. Output: the sum.

Your program reads from stdin and prints to stdout.

Example 1

Input: 1 2 3

Output: 6

Hints

JavaScriptES6Rest
Rest Parameter Sum | CodeForge AI