Program n1; const n=15; var a: array [1..n] of integer; i,rnd: integer; begin randomize; for i:=1 to n do begin rnd:=random(21)-10; if (i mod 2=0) and (rnd<0) then a[i]:=rnd; if (i mod 2<>0) and (rnd>0) then a[i]:=rnd; end; for i:=1 to n do write(a[i],' '); end.
const n=15;
var a: array [1..n] of integer;
i,rnd: integer;
begin
randomize;
for i:=1 to n do
begin
rnd:=random(21)-10;
if (i mod 2=0) and (rnd<0) then a[i]:=rnd;
if (i mod 2<>0) and (rnd>0) then a[i]:=rnd;
end;
for i:=1 to n do write(a[i],' ');
end.