Program HOC24;
var min,max,n,i: integer;
t: longint;
a: array[1..1000] of integer;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Cac so chan trong mang la: ');
for i:=1 to n do if a[i] mod 2=0 then write(a[i],' ');
writeln;
t:=0;
for i:=1 to n do if a[i] mod 2=1 then t:=t+a[i];
writeln('Tong cac so le la: ',t);
min:=a[1]; max:=a[1];
for i:=1 to n do
begin
if a[i]>max then max:=a[i];
if a[i] <max then max:=a[i];
end;
writeln('Gia tri lon nhat la: ',max);
write('Gia tri nho nhat la:' ,min);
readln
end.