Const n=3; m=4;
var a:array[1..n,1..m] of integer;
i,j:integer;
begin
for i:=1 to n do
for j:=1 to m do
begin
write('a[',i,',',j,'] =');
readln(a[i,j]);
end;
writeln('Исходный массив:');
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j]:4);
writeln;
end;
for i:=1 to n do
for j:=1 to m do
if a[i,j] mod 2 = 0 then a[i,j]:=a[i,j] div 2;
writeln('Полученный массив:');
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j]:4);
writeln;
end;
end.
Пример:
a[1,1] =45
a[1,2] =32
a[1,3] =76
a[1,4] =12
a[2,1] =85
a[2,2] =19
a[2,3] =35
a[2,4] =74
a[3,1] =65
a[3,2] =37
a[3,3] =83
a[3,4] =67
Исходный массив:
45 32 76 12
85 19 35 74
65 37 83 67
Полученный массив:
45 16 38 6
85 19 35 37
65 37 83 67