program baigiai;
uses crt;
var A:array[1..1000] of integer;
n,i,max,t,tc:integer;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']= '); readln(A[i]);
end;
writeln('b. Mang da nhap la: ');
for i:=1 to n do write(A[i],' ');
writeln;
max:=A[1];
for i:=1 to n do
if A[i]>max then max:=A[i];
writeln('b. So lon nhat la: ',max);
write('d. Cac so le la: ');
for i:=1 to n do
if A[i] mod 2=1 then write(A[i],' ');
writeln;
write('e. Cac so chan la: ');
for i:=1 to n do
if A[i] mod 2=0 then write(A[i],' ');
writeln;
t:=0; tc:=0;
for i:=1 to n do
begin
t:=t+A[i];
if A[i] mod 2=0 then tc:=tc+A[i];
end;
writeln('f. Tong mang A la: ',t,' va tong cac so chan la: ',tc);
readln;
end.