program ee;
{$APPTYPE CONSOLE}
type
Tarr1=array[1..5] of integer;
Tarr2=array[1..10] of integer;
const
a:Tarr1=(1,2,3,4,11); //定义常量数组
b:Tarr1=(6,7,8,9,10);
var
c:Tarr2;
i,j,k:integer;
begin
i:=1;k:=1;j:=1;
while((i<=5) and (k<=5)) do // j 不需再行判断
begin
if(a[i]<=b[k]) then
begin
c[j]:=a[i];
inc(i);
inc(j);
end
else
begin
c[j]:=b[k];
inc(k);
inc(j);
end
end;
while(i<=5) do // j 不需再行判断
begin
c[j]:=a[i];
inc(i);
inc(j);
end;
while(k<=5) do // j 不需再行判断
begin
c[j]:=b[k];
inc(k);
inc(j);
end;
for j:=1 to 10 do
write(c[j],'---');
readln;
end.