program tim_max_min;
uses crt;
var i,n,max,min:integer;
a:array[1..100] of integer;
begin
Clrscr;
write('Ban muon nhap bao nhieu phan tu= ');readln(n);
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);
writeln('Vi tri cua so lon nhat la: ');
for i:=1 to n do
if max=a[i] then write(i:4);
writeln;
writeln('Vi tri cua so nho nhat la: ');
for i:=1 to n do
if min=a[i] then write(i:4);
readln;
end.
Chúc Bạn Hc Thật Tốt