1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var
v : integer;
count, max : integer;
prev : integer;
begin
count := 0; max := 0;
repeat
v := ReadInteger;
if (count = 0) or (prev * v > 0) then inc(count)
else // знаки не совпадают
if max < count then max := count;
count := 1;
end;
prev := v;
until v = 0;
print('max = ', max)
end.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var
v : integer;
count, max : integer;
prev : integer;
begin
count := 0; max := 0;
repeat
v := ReadInteger;
if (count = 0) or (prev * v > 0) then inc(count)
else // знаки не совпадают
begin
if max < count then max := count;
count := 1;
end;
prev := v;
until v = 0;
print('max = ', max)
end.