Ответ:
const g = 5; v = 7;
var a: array[1..g,1..v] of integer;
i,j,maxj,minj,p:integer;
begin
writeln('Массив: ');
for i:=1 to g do
for j:=1 to v do
a[i,j]:=random(90)+10;
write(a[i,j]:4)
end;
writeln
maxj:=1;
minj:=1;
if a[i,j]>a[i,maxj] then maxj:=j;
if a[i,j]<a[i,minj]then minj:=j;
p:=a[i,maxj];
a[i,maxj]:=a[i,minj];
a[i,minj]:=p;
writeln;
writeln('Преобразованный массив: ');
for j:=1 to v do write(a[i,j]:4);
end.
Объяснение:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
const g = 5; v = 7;
var a: array[1..g,1..v] of integer;
i,j,maxj,minj,p:integer;
begin
writeln('Массив: ');
for i:=1 to g do
begin
for j:=1 to v do
begin
a[i,j]:=random(90)+10;
write(a[i,j]:4)
end;
writeln
end;
for i:=1 to g do
begin
maxj:=1;
minj:=1;
for j:=1 to v do
begin
if a[i,j]>a[i,maxj] then maxj:=j;
if a[i,j]<a[i,minj]then minj:=j;
end;
p:=a[i,maxj];
a[i,maxj]:=a[i,minj];
a[i,minj]:=p;
end;
writeln;
writeln('Преобразованный массив: ');
for i:=1 to g do
begin
for j:=1 to v do write(a[i,j]:4);
writeln
end;
end.
Объяснение: