uses crt;
var j,tg,max,i,n:longint;
a:array[1..1000000] of longint;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
end;
max:=a[1];
for i:=2 to n do
if a[i]>max then max:=i;
write('Vi tri phan tu lon nhat la: ',max); writeln;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]<a[j] then
begin
tg:=a[i];
a[i]:=a[j];
a[j]:=tg;
end;
for i:=1 to n do
write(a[i],' ');
readln
end.