for i:=2 to n do begin t:=a[i]; a[0]:=a[i]; j:=i; while t<a[j-1] do begin a[j]:=a[j-1]; Dec(j); end; a[j]:=t; end; writeln;