Easy
C-001cSum of an Array (Inventory)
Problem
You run a small shop. Given N daily sales figures, compute the total revenue for the week.
Input
Line 1: n. Line 2: n integers separated by spaces.
Output
Single integer — the sum.
Constraints
1 ≤ n ≤ 10^5, 0 ≤ a[i] ≤ 10^6
Sample input
5 100 200 150 300 250
Sample output
1000
Explanation
100+200+150+300+250 = 1000.
arraysloopsbasics@Infosys@TCS
Visible test cases
in: 5 100 200 150 300 250
out: 1000
in: 1 42
out: 42
Your solution — run it, use AI if stuck
c
