var
a: array [1..5,1..6] of integer;
i,j,sum,ip,jp:integer;
flag:boolean;
begin
flag:=false;
sum:=0;
for i:=1 to 5 do
for j:= 1 to 6 do
a[i,j]:=random(31)-10;
write(a[i,j]:4);
if a[i,j] mod 2 = 0 then
sum:=sum+a[i,j];
if not flag then
if abs(a[i,j] mod 2) = 1 then
flag:=true;
ip:=i;
jp:=j;
end;
writeln;
a[ip,jp]:=sum;
for j:=1 to 6 do
end.
var
a: array [1..5,1..6] of integer;
i,j,sum,ip,jp:integer;
flag:boolean;
begin
flag:=false;
sum:=0;
for i:=1 to 5 do
begin
for j:= 1 to 6 do
begin
a[i,j]:=random(31)-10;
write(a[i,j]:4);
if a[i,j] mod 2 = 0 then
sum:=sum+a[i,j];
if not flag then
if abs(a[i,j] mod 2) = 1 then
begin
flag:=true;
ip:=i;
jp:=j;
end;
end;
writeln;
end;
a[ip,jp]:=sum;
writeln;
for i:=1 to 5 do
begin
for j:=1 to 6 do
write(a[i,j]:4);
writeln;
end;
end.