исправить ошибки в паскале
program exp3;
const m=5; n=3;
type matr = array [1..m,1..n] of integer;
var m: matr; b, i,j, k : integer; повторно объявленный идентификатор
begin
clrscr ;
randomize;
for i:= 1 to m do begin
for j:= 1 to n do begin
m [i,j] := random (101) ;
end ; end ;
k:= n/2 ; попытка присвоить integer тип real
for j:= 1 to k do begin
for i:= 1 to m do begin
b := m [ i, j ] ;
m [ i , j ] := m [ i, n - j + 1 ] ;
m [i, n - j +1 ] := b ;
end ; end ;
for i:= 1 to m do begin
for j:= 1 to n do begin
writeln ('m[i,j]: 5) ; неверное выражение
end ;
writeln ; readln ; end; end .
Answers & Comments
uses crt;
const
m = 5;
n = 3;
type
matr = array [1 .. m, 1 .. n] of integer;
var
A: matr;
b, i, j, k: integer;
begin
clrscr;
randomize;
for i := 1 to m do
begin
for j := 1 to n do
begin
A[i, j] := random(101);
end;
end;
k := n div 2;
for j := 1 to k do
begin
for i := 1 to m do
begin
b := A[i, j];
A[i, j] := A[i, n - j + 1];
A[i, n - j + 1] := b;
end;
end;
for i := 1 to m do
begin
for j := 1 to n do
begin
write(A[i,j]: 5) ;
end;
writeln;
end;
readln;
end.