Const n = 10; var x:array[1..n,1..n] of integer; i,j,k,xmin: integer; begin Randomize; Writeln('Исходный массив'); xmin:=32767; for i := 1 to n do begin for j := 1 to n do begin k:= Random(1001); x[i,j]:=k; Write(x[i,j]:5); if (k mod 2=0) and (k mod 3<>0) then if xmin>k then xmin:=k end; Writeln end; Writeln('Минимальное четное, не кратное 3: ',xmin) end.
Const n=10;m=8; var a:array[1..n,1..m]of integer; b:array[1..m]of integer; i,j,min:integer; begin for i:=1 to n do begin writeln; for j:=1 to m do begin a[i,j]:=random(100); write(a[i,j]:4); end; end; writeln; for j:=1 to m do begin min:=a[i,1]; for i:=1 to n do if a[i,j]<min then min:=a[i,j]; b[j]:=min; end; for i:=1 to m do write(b[i]:4); end.
n = 10;
var
x:array[1..n,1..n] of integer;
i,j,k,xmin: integer;
begin
Randomize;
Writeln('Исходный массив');
xmin:=32767;
for i := 1 to n do
begin
for j := 1 to n do
begin
k:= Random(1001); x[i,j]:=k;
Write(x[i,j]:5);
if (k mod 2=0) and (k mod 3<>0) then
if xmin>k then xmin:=k
end;
Writeln
end;
Writeln('Минимальное четное, не кратное 3: ',xmin)
end.
Тестовое решение:
Исходный массив
804 425 286 223 93 517 955 301 708 171
934 347 789 960 195 784 651 76 498 402
360 170 940 62 428 226 959 173 129 723
232 732 777 152 56 631 974 17 620 271
61 314 974 787 70 574 756 856 232 497
385 34 25 652 966 634 486 224 796 868
558 781 171 985 940 201 570 636 903 564
810 633 457 227 341 45 196 153 992 854
470 103 942 633 338 197 707 125 187 423
144 750 221 753 713 280 143 989 847 869
Минимальное четное, не кратное 3: 34
n=10;m=8;
var
a:array[1..n,1..m]of integer;
b:array[1..m]of integer;
i,j,min:integer;
begin
for i:=1 to n do
begin
writeln;
for j:=1 to m do
begin
a[i,j]:=random(100);
write(a[i,j]:4);
end;
end;
writeln;
for j:=1 to m do
begin
min:=a[i,1];
for i:=1 to n do
if a[i,j]<min then
min:=a[i,j];
b[j]:=min;
end;
for i:=1 to m do
write(b[i]:4);
end.