uses crt;
var a:array[1..1000]of integer;
dem,n,i,spt,tl,tc:integer;
begin
clrscr;
dem:=0;
repeat
write('n='); readln(n);
dem:=dem+1;
a[dem]:=n;
until n=0;
spt:=dem-1;
writeln('Cac so le ban vua nhap la: ');
tl:=0;
for i:=1 to spt do
if a[i] mod 2<>0 then
begin
write(a[i]:4);
tl:=tl+a[i];
end;
writeln;
writeln('Tong cac so le ban vua nhap la: ',tl);
writeln('Cac so chan ban vua nhap la: ');
tc:=0;
for i:=1 to spt do
if a[i] mod 2=0 then
begin
write(a[i]:4);
tc:=tc+a[i];
end;
writeln;
writeln('Tong cac so chan ban vua nhap la: ',tc);
readln;
end.