Tổng chẵn

View as PDF

Submit solution

Points: 100.00 (partial)
Time limit: 1.0s
Memory limit: 1G
Input: stdin
Output: stdout

Author:
Problem type
Allowed languages
C, C++, GAS64, Pascal, Perl, PHP, Python, Sed, TCL, Text

Nhập vào một dãy N số nguyên A1,A2,...,AN (N10000,|Ai|109).

Hãy in ra màn hình tổng các phần tử có giá trị chẵn.

Dữ liệu vào:

  • Dòng đầu tiên chứa số N
  • Dòng thứ 2 chứa N số nguyên A1,A2,...,AN.

Kết quả:

  • Tổng các phần tử có giá trị chẵn của dãy số.

Sample Input

Copy
7
7 -6 -4 19 22 51 82

Sample Output

Copy
94

Comments

Please read the guidelines before commenting.


There are no comments at the moment.