uses crt;
const fi='output.txt';
var a:array[1..100]of integer;
i,n:integer;
f:text;
begin
clrscr;
assign(f,f1); rewrite(f);
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Day ban vua nhap la: ');
for i:=1 to n do
write(a[i]:5);
t:=0;
writeln('Cac so duong la: ');
for i:=1 to n do
if a[i]>0 then
begin
t:=t+a[i];
write(a[i]:4);
end;
writeln;
writeln('Tong cac so duong la: ',t);
for i:=1 to n do
write(f,a[i]:5);
close(f);
readln;
end.