uses crt;var n,i,d,min:byte;
tong:integer;
a:array[1..20] of integer;
BEGIN
clrscr;
write('Nhap N:'); readln(n);
{NHAP DAY SO}
for i:=1 to n do
begin
write('Nhap a[',i,']');
readln(a[i]);
end;
{TIM PHAN TU NHO NHAT}
min:=a[1];
for i:=2 to n do
if a[i]<min then min:=a[i];
{TINH TONG CAC SO DUONG}
tong:=0;
for i:=1 to n do
if a[i]>0 then tong:=tong+a[i];
{TINH SO LUONG SO AM TRONG DAY}
d:=0;
for i:=1 to n do
if a[i]<0 then inc(d);
{GHI KET QUA RA MAN HINH}
writeln('a)Phan tu nho nhat trong day la:',min);
writeln('b)Tong cac so duong la:',tong);
writeln('c)Co ',d,' so am trong day.');
writeln('d)Cac so nguyen duong trong day la:');
for i:=1 to n do
if a[i]>0 then write(a[i],' ');
readln
END.
Chúc bạn học tốt.
Cho mình xin câu trả lời hay nhất nha.