uses crt;
var a: array[1..100] of integer;
i,n,s,d: integer;
tbc: real;
function snt(n: integer): boolean;
var i,d: integer;
begin
for i:=1 to n do if n mod i=0 then d:=d+1;
if d=2 then snt:=true else snt:=false;
end;
begin
clrscr;
Write ('nhap so luong pt: '); readln (n);
for i:=1 to n do
begin
write ('nhap phan tu thu ',i,': '); readln (a[i]);
if (a[i]>0) and (a[i] mod 2=0) then begin tbc:=tbc+a[i]; d:=d+1; end;
if snt(a[i])=true then s:=s+a[i];
end;
tbc:=tbc/d;
writeln ('trung binh cong cac so duong chan trong mang la: ',tbc:1:2);
writeln ('tong cac so nguyen to trong mang: ',s);
readln;
end.