Const n=10; var a:array[1..10] of integer; i,j,z:integer; begin writeln('Исходный массив: '); for i:=1 to n do begin a[i]:=random(100); write(a[i]:4); end; writeln; for i:=6 to 9 do for j:=i+1 to 10 do if a[i]<a[j] then begin z:=a[i]; a[i]:=a[j]; a[j]:=z; end; Write('Результат: '); for i:=1 to 10 do Write(a[i]:4); end.
var a:array[1..10] of integer;
i,j,z:integer;
begin
writeln('Исходный массив: ');
for i:=1 to n do begin
a[i]:=random(100);
write(a[i]:4);
end;
writeln;
for i:=6 to 9 do
for j:=i+1 to 10 do
if a[i]<a[j] then
begin
z:=a[i];
a[i]:=a[j];
a[j]:=z;
end;
Write('Результат: ');
for i:=1 to 10 do
Write(a[i]:4);
end.