#GYM104599A. Tall Bots Short Bots
Tall Bots Short Bots
Description
Lazy Bob has $N$ ($1 ≤ N ≤ 1,000$) robot friends, each with their own height $h_i$ ($1 ≤ h_i ≤ 10^6$). Bob wonders, if he stacks all of the robot friends on top of each other to make one tall robot, how tall will that mega-robot be? Because he has so many robot friends, he needs your help to complete this task.
Line 1: One integer, $N$. Line 2: $N$ space-separated integers $h_i$.
Line 1: One integer representing the height of the mega-robot formed out of all $N$ stacked robot friends.
Input
Line 1: One integer, $N$. Line 2: $N$ space-separated integers $h_i$.
Output
Line 1: One integer representing the height of the mega-robot formed out of all $N$ stacked robot friends.
5
7 2 12 4 8
33
Note
$1 ≤ N ≤ 1,000$
$1 ≤ h_i ≤ 10^6$
If Bob stacks all 5 of his robot friends together, the height of the resulting mega-robot would be $7 + 2 + 12 + 4 + 8 = 33$