Косте

 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
const
N=5;
M=10;
var
A: array [1..N, 1..M] of integer;
i, j: byte; p1, p2: byte; p: boolean;
BEGIN
randomize; p1:=0; p2:=0;
for i:=1 to N do
begin
p:=true;
for j:=1 to M do
begin
A[i, j]:=random(100)-25;
if (A[i, j]<0) then p:=false;
end;
if p then
if p1>0 then p2:=i
else p1:=i;
end;
if (p1>0) and (p2>0) then
begin
if (p1>0) then writeln('1 строка: ', p1);
if (p2>0) then writeln('2 строка: ', p2);
end else writeln(0);
END.