Sum of N integers
Time limit0.1sMemory limit512 MB
Read N integers and print their sum, which needs a 64-bit integer type.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
You are given integers. Write a program that computes the sum of those integers.
When and every integer are at their largest, the sum is , so a 32-bit integer type cannot hold the answer. Use a 64-bit integer type.
Input
The first line has the number of integers ().
The second line has the integers, separated by single spaces. Each integer is between and .
Output
Print the sum of the given integers on the first line.