Var ar:array[1..10] of integer; ar1:array[1..10] of integer; ar2:array[1..10] of integer; i,n1,n2:integer; begin; randomize; writeln('First array:'); for i:=1 to 10 do begin; ar[i]:=random(10,99); if odd(ar[i]) then //если нечётно begin; inc(n1); ar1[n1]:=ar[i]; end else begin; inc(n2); ar2[n2]:=ar[i]; end; write(ar[i]:4); end;
writeln; writeln('Array A:'); for i:=1 to n1 do write(ar1[i]:4);
writeln; writeln('Array B:'); for i:=1 to n2 do write(ar2[i]:4); end.
ar1:array[1..10] of integer;
ar2:array[1..10] of integer;
i,n1,n2:integer;
begin;
randomize;
writeln('First array:');
for i:=1 to 10 do begin;
ar[i]:=random(10,99);
if odd(ar[i]) then //если нечётно
begin;
inc(n1);
ar1[n1]:=ar[i];
end
else
begin;
inc(n2);
ar2[n2]:=ar[i];
end;
write(ar[i]:4);
end;
writeln;
writeln('Array A:');
for i:=1 to n1 do
write(ar1[i]:4);
writeln;
writeln('Array B:');
for i:=1 to n2 do
write(ar2[i]:4);
end.