program P1;
uses
crt;
var
A : array[1..3] of array [1..4] of longint;
i,j : integer;
begin
clrscr;
randomize;
writeln('Massiv : ');
for i := 1 to 3 do
begin
writeln('');
for j := 1 to 4 do
begin
A[i][j] := random(15)+random(5)-random(5);
write(A[i][j]:2,' ');
end;
end;
for i := 1 to 3 do
for j := 1 to 4 do
begin
if A[i][j] > 10 then
A[i][j] := i - j;
if (A[i][j] >= -5) and (A[i][j] <= 5) then
A[i][j] := sqr(i);
end;
writeln('');
writeln('-----------------');
writeln('Itogoviy massiv : ');
for i := 1 to 3 do
begin
writeln('');
for j := 1 to 4 do
begin
write(A[i][j]:2,' ');
end;
end;
readln;
readln;
end.