const n=10;
var a,x,y:array[1..n] of integer;
k,p,i:integer;
begin
for i:=1 to n do begin
a[i]:=random(51)-25;
write(a[i]:4);
end;
k:=1;
p:=1;
if a[i]>=0 then begin x[p]:=a[i]; p:=p+1; end;
if a[i]<0 then begin y[k]:=a[i]; k:=k+1; end;
writeln;
for i:=1 to p do
write(x[i]:3);
for i:=1 to k do
write(y[k]:3);
end.
===== PascalABC.NET =====
var n := ReadInteger('n =');
var a := ArrRandom(n, -99, 99);
a.Println;
var x := a.Where(p -> p > 0).ToArray;
var y := a.Where(p -> p < 0).ToArray;
x.Println;
y.Println
const n=10;
var a,x,y:array[1..n] of integer;
k,p,i:integer;
begin
for i:=1 to n do begin
a[i]:=random(51)-25;
write(a[i]:4);
end;
k:=1;
p:=1;
for i:=1 to n do begin
if a[i]>=0 then begin x[p]:=a[i]; p:=p+1; end;
if a[i]<0 then begin y[k]:=a[i]; k:=k+1; end;
end;
writeln;
for i:=1 to p do
write(x[i]:3);
writeln;
for i:=1 to k do
write(y[k]:3);
end.
===== PascalABC.NET =====
begin
var n := ReadInteger('n =');
var a := ArrRandom(n, -99, 99);
a.Println;
var x := a.Where(p -> p > 0).ToArray;
var y := a.Where(p -> p < 0).ToArray;
x.Println;
y.Println
end.