Var a:array[1..20] of integer; i,j,x:integer; begin randomize; writeln('Исходный массив'); for i:=1 to 20 do begin a[i]:=-10+random(40); write(a[i]:4); end; writeln; for i:=1 to 19 do for j:=i+1 to 20 do if a[i]<a[j] then begin x:=a[i]; a[i]:=a[j]; a[j]:=x; end; writeln('Новый массив'); for i:=1 to 20 do write(a[i]:4); readln; end.
a:array[1..20] of integer;
i,j,x:integer;
begin
randomize;
writeln('Исходный массив');
for i:=1 to 20 do
begin
a[i]:=-10+random(40);
write(a[i]:4);
end;
writeln;
for i:=1 to 19 do
for j:=i+1 to 20 do
if a[i]<a[j] then
begin
x:=a[i];
a[i]:=a[j];
a[j]:=x;
end;
writeln('Новый массив');
for i:=1 to 20 do
write(a[i]:4);
readln;
end.