Немного исправил программу:
program Alex1;
var
a: array[1..10] of integer;
max, i: integer;
begin
for i := 1 to 10 do
read(a[i]);
writeln('Исходный массив');
for i := 1 to 10 do
write(a[i], ' ');
max := a[1];
for i := 2 to 10 do
if a[i] > max then max := a[i];
for i := 1 to 10 do
if a[i] < 0 then a[i] := max;
writeln;
writeln('Новый массив');
for i := 1 to 10 do
write(a[i], ' ');
<span>end.</span>
var a:array[1..10] of integer;
i,temp,j:integer;
begin
for i:=1 to 10 do begin
a[i]:=random (26);
write (a[i]:3);
end;
writeln;
for i:=1 to 10 do begin
for j:=1 to 10 do
if a[i]<a[j] then
begin
temp:=a[i];
a[i]:=a[j];
a[j]:=temp;
end;
end;
for i:=1 to 10 do
write(a[i]:3);
end.