Refer
uses crt;
var i,n,m:longint;
a:array[1..1000]of integer;
begin
write('nhap do dai cua day so:');readln(n);
m:=0;
for i:=1 to n do begin
write('nhap phan tu thu ',i,' cua mang:');readln(a[i]);
m:=m+a[i];
end;
write(' tong cua day so la:',m);
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long a[1000],n,i,t;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
t=0;
for (i=1; i<=n; i++)
if (a[i]%2==0) t+=a[i];
cout<<t;
return 0;
}