картинки
Объяснение:
program Chernovik;
var a:array[1..25] of integer;
i,j,v,m: integer;
begin
writeln('Массив: ');
randomize;
for i:=1 to 25 do
a[i]:=random(51)+49;
write (a[i]:5)
end;
writeln;
m:=i;
for j:=i to 25 do
if a[j]>a[m] then m:=j;
v:=a[i];
a[i]:=a[m];
a[m]:=v
for i:=1 to 25 do write (a[i]:5)
end.
картинки
Объяснение:
program Chernovik;
var a:array[1..25] of integer;
i,j,v,m: integer;
begin
writeln('Массив: ');
randomize;
for i:=1 to 25 do
begin
a[i]:=random(51)+49;
write (a[i]:5)
end;
writeln;
writeln('Массив: ');
for i:=1 to 25 do
begin
m:=i;
for j:=i to 25 do
if a[j]>a[m] then m:=j;
v:=a[i];
a[i]:=a[m];
a[m]:=v
end;
for i:=1 to 25 do write (a[i]:5)
end.