Кате

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const
N=5;
M=10;
var
A: array [1..N, 1..M] of byte;
mina, minb: byte;
suma, sumb: integer;
i, j: byte;
BEGIN
randomize;
for i:=1 to N do
begin
for j:=1 to M do
begin
A[i, j]:=random(100);
write(A[i, j]:3);
end; writeln;
end;
suma:=32767; sumb:=0;
for i:=1 to N do
begin
for j:=1 to M do
sumb:=sumb+A[i, j];
if (sumb<suma) then
begin
suma:=sumb;
mina:=i;
end; sumb:=0;
end; suma:=32767;
for j:=1 to M do
begin
for i:=1 to N do
sumb:=sumb+A[i, j];
if (sumb<suma) then
begin
suma:=sumb;
minb:=j;
end; sumb:=0;
end;
writeln(' Строка: ', mina);
writeln('Столбец: ', minb);
END.