nb := 0;
nc := 0;
for i := 1 to n do begin
readln(a[i]);
if a[i] > 0 then begin
inc(nb);
b[nb] := a[i];
else
if a[i] < 0 then begin
inc(nc);
c[nc] := a[i];
end;
end;
neg_first := 0; neg_last := 0;
pos_first := 0; pos_last := 0;
nb := 0;
nc := 0;
for i := 1 to n do begin
readln(a[i]);
if a[i] > 0 then begin
inc(nb);
b[nb] := a[i];
if pos_first = 0 then begin pos_first := i; pos_last := i end
else pos_last := i;
else
if a[i] < 0 then begin
inc(nc);
c[nc] := a[i];
if neg_first = 0 then begin neg_first := i; neg_last := i end
else neg_last := i;
end;
end;
var
pf:byte; полож. 1 вхождение
pl:byte; --\\-- последнее вхожд.
mf:byte; отрицательное 1
ml:byte; отрицательное послед.
begin
for pf:=1 to n do
if A[pf]>0 then break;
for pl:h downto 1 do
if A[pl]<0 then break;
for mf:=1 to n do
if A[mf]>0 then break;
for ml:=n downto 1 do
if A[ml]< then break;
program stas3;
uses crt;
var
pf,pl,mf,ml:byte;
n:byte;
a:array [1..n] of integer;
i,nb,nc:integer;
begin
writeln ('vvidite n') ;
readln (n);
nb:=0;
nc:=0;
for i:= 1 to n do begin
readln (a[i]);
if a[i]>0 then begin
inc(nb);
b[nb]:=a[i];
else
if a[i]<0 then begin
inc(nc);
c[nc]:=a[i];
end;
end;
begin
pf:=0;
pl:=0;
mf:=0;
ml:=0;
for pf:=1 to n do
if a[pf]>0 then break;
for pl:=n downto 1 do
if a[pl]<0 then break;
for mf:=1 to n do
if a[mf]>0 then break;
for ml:=n downto 1 do
if a[ml]<0 then break;
end.
program stas3;
uses crt;
var
pf,pl,mf,ml:byte;
n:byte;
a,b,c:array [1..100] of integer;
i,nb,nc:integer;
begin
writeln ('vvidite n') ;
readln (n);
nb:=0;
nc:=0;
for i:= 1 to n do begin
readln (a[i]);
if a[i]>0 then begin
inc(nb);
b[nb]:=a[i]
end
else
if a[i]<0 then begin
inc(nc);
c[nc]:=a[i];
end;
end;
pf:=0;
pl:=0;
mf:=0;
ml:=0;
for pf:=1 to n do
if a[pf]>0 then break;
for pl:=n downto 1 do
if a[pl]<0 then break;
for mf:=1 to n do
if a[mf]>0 then break;
for ml:=n downto 1 do
if a[ml]<0 then break;
end.