program tim_max_min ;
var i,n,max,min:integer;
a:array[1..100] of integer;
begin
write('nhap do dai cua day so n=');readln(n);
writeln('nhap cac phan tu cua day so :');
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
end;
max :=a[1] ; min:=a[1];
for i:=2 to n do
begin
if max <a[i] then max :=a[i];
if min >a[i] then min :=a[i];
end;
writeln('so lon nhat la:',max);
writeln('so be nhat la:',min);
readln
end.
uses crt;
var a:array[1..100]of integer;
i,n,sln,snn:integer;
begin
clrscr;
write('nhap so phan tu:'); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{-------------------------------------------------}
for i:=1 to n do write(a[i]:4);
{---------------------------------------------------}
writeln;
sln:=a[1];
for i:=1 to n do
if sln<a[i] then sln:=a[i];
snn:=a[1];
for i:=1 to n do
if snn>a[i] then snn:=a[i];
writeln('so nho nhat cua day la: ',snn);
writeln('so lon nhat cua day la: ',sln);
readln;
end.