Tổng vị trí chẵn

View as PDF

Submit solution

Points: 1.00
Time limit: 1.0s
Memory limit: 64M
Input: stdin
Output: stdout

Authors:
Problem type

Cho mảng 1 chiều gồm n phần tử số nguyên. Hãy tính tổng các phần tử ở vị trí chẵn của mảng.

INPUT

Dòng đầu tiên là số nguyên ~n (2 \leq n \leq 10^3)~

Dòng tiếp theo chứa n số nguyên ~a_0,a_1,a_2,...,a_{n-1} (1 \leq a_i \leq 10^6)~

OUTPUT

Đáp án của bài toán

SAMPLE INPUT 1

5
1 2 3 4 5

SAMPLE OUTPUT 1

9

Comments

Please read the guidelines before commenting.


There are no comments at the moment.