uses crt;
var a,b,c:array[1..100]of integer;
dem,dem1,n,i,j:integer;
begin
clrscr;
write('nhap chieu dai cua day:'); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{-----------------------------------------------}
write('day A=');
for i:=1 to n do write(a[i]:4);
{-------------xu-ly-so-duong--------------------}
writeln;
writeln('day cac so duong sau khi sao chep sang B la: ');
dem:=0;
for i:=1 to n do
begin
if a[i]>0 then
begin
dem:=dem+1;
b[dem]:=a[i];
end;
end;
for i:=1 to dem do write(b[i]:4);
{---------------xu-ly-so-am----------------------}
writeln;
writeln('day cac so am sau khi sao chep sang C la: ');
dem1:=0;
for i:=1 to n do
begin
if a[i]<0 then
begin
dem1:=dem1+1;
c[dem1]:=a[i];
end;
end;
for i:=1 to dem1 do write(c[i]:4);
readln;
end.