Sum of Odd Positions

Python Medium 3 views
Back to Questions

Problem Description

Read n integers, sum the values at odd positions (1st, 3rd, 5th...) and output the sum.

Input Format

First line n. Second line n integers.

Output Format

One integer sum.

Sample Test Case

Input:
5 10 20 30 40 50
Output:
90

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next