Skip to content

Instantly share code, notes, and snippets.

@beholderrk
Created April 7, 2014 20:14
Show Gist options
  • Save beholderrk/10043583 to your computer and use it in GitHub Desktop.
Save beholderrk/10043583 to your computer and use it in GitHub Desktop.
Задача егэ С2
Program HelloWorld(output);
const n = 30;
var i : integer;
l : integer;
ar : array [1..n] of integer;
max : integer;
begin
ar[1] := -1;
ar[2] := -2;
ar[3] := -3;
ar[4] := 2;
ar[5] := 2;
ar[6] := 2;
ar[7] := 2;
ar[8] := -2;
ar[9] := 2;
ar[10] := -2;
ar[11] := -2;
ar[12] := -2;
ar[13] := -2;
l := 0;
max := 0;
for i:=1 to n do
begin
if ar[i] < 0 then
begin
l:=l+1;
end;
if (ar[i] < 0) and (ar[i+1] >= 0) then
begin
if max < l then
begin
max := l;
end;
l := 0;
end;
end;
for i:=1 to n do
begin
Write(ar[i]);
end;
writeln(l);
writeln(max);
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment