Var a:array[1..10,1..10] of integer; i, j, j1, max, s: integer; begin for i:=1 to 10 do for j:=1 to 10 do readln(a[i,j]); max := a[1,1]; for i:=1 to 10 do for j:=1 to 10 do if a[i,j]>max then begin max := a[i,j]; j1:=j; end; for i:=1 to 10 do begin s:=a[i, 1]; a[i, 1] := a[i, j1]; a[i, j1] := s; end; end.
Answers & Comments
Verified answer
Vara:array[1..10,1..10] of integer;
i, j, j1, max, s: integer;
begin
for i:=1 to 10 do
for j:=1 to 10 do
readln(a[i,j]);
max := a[1,1];
for i:=1 to 10 do
for j:=1 to 10 do
if a[i,j]>max then
begin
max := a[i,j];
j1:=j;
end;
for i:=1 to 10 do
begin
s:=a[i, 1];
a[i, 1] := a[i, j1];
a[i, j1] := s;
end;
end.