You are given an array A consisting of N integers.
Task
Print the sum of the elements in the array.
Note: Some of the integers may be quite large.
Input Format
Output format
Print a single value representing the sum of the elements in the array.
Constraints
1<=N<=10
0<=a[i]<=10^10
import math
import os
import random
import re
import sys
# Complete the aVeryBigSum function below.
def aVeryBigSum(ar):
sum = 0
for i in range(ar_count):
sum = sum + int(ar[i])
return sum
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
ar_count = int(input())
ar = list(map(int, input().rstrip().split()))
result = aVeryBigSum(ar)
fptr.write(str(result) + '\n')
fptr.close()
Comments
Leave a comment