1. дан двухмерный массив a(n,m). найти произведение отрицательных четных элементов второго столбца массива. 2. дан двухмерный массив m*n. получите одномерный массив b, элементы которого равны min элементам по строкам.
1)uses crt; const n=5; m=5; var a:array[1..n,1..m] of integer; pr,i,j:integer; begin for i:=1 to n do begin for j:=1 to m do read(a[i,j]); end; writeln; pr:=1; for i:=1 to n do for j:=2 to 2 do if (a[i,j]<0) and (a[i,j] mod 2=0) then pr:=pr*a[i,j]; writeln(pr); end. 2)uses crt; const n=5; m=5; var b:array[1..n] of integer; a:array[1..n,1..m] of integer; min,i,j,r:integer; begin for i:=1 to n do begin for j:=1 to m do read(a[i,j]); end; writeln; min:=1000; r:=1; repeat for i:=r to r do for j:=1 to m do if a[i,j]<min then begin min:=a[i,j]; b[r]:=a[i,j] end; min:=1000; inc(r); until r>n; for i:=1 to n do write(b[i],' '); end.
const n=5;
m=5;
var a:array[1..n,1..m] of integer;
pr,i,j:integer;
begin
for i:=1 to n do
begin
for j:=1 to m do
read(a[i,j]);
end;
writeln;
pr:=1;
for i:=1 to n do
for j:=2 to 2 do
if (a[i,j]<0) and (a[i,j] mod 2=0) then pr:=pr*a[i,j];
writeln(pr);
end.
2)uses crt;
const n=5;
m=5;
var b:array[1..n] of integer;
a:array[1..n,1..m] of integer;
min,i,j,r:integer;
begin
for i:=1 to n do
begin
for j:=1 to m do
read(a[i,j]);
end;
writeln;
min:=1000;
r:=1;
repeat
for i:=r to r do
for j:=1 to m do
if a[i,j]<min then begin min:=a[i,j]; b[r]:=a[i,j] end;
min:=1000;
inc(r);
until r>n;
for i:=1 to n do
write(b[i],' ');
end.