Uses crt; const n=10; var a,b,c: array [1..n] of integer; x,y,z,k: integer; begin y:=0; z:=0; for x:=1 to n do begin a[x]:=random(100)+1; if a[x] mod 2=0 then begin inc(y); b[y]:=a[x]; end else begin inc(z); c[z]:=a[x]; end; write(a[x]:4); end; writeln; k:=y; for y:=1 to k do write(b[y]:4); writeln; k:=z; for z:=1 to k do write(c[z]:4); end.
Program test; var i,k,z:integer; m:array[1..100] of integer; c:array[1..100] of integer; n:array[1..100] of integer; begin randomize; for i:=1 to 10 do begin m[i]:=random(1000); if m[i] mod 2 =0 then begin k:=k+1; c[k]:=m[i]; end else begin z:=z+1; n[z]:=m[i]; end; end; for i:=1 to z do write(' НЕЧЕТНЫЕ',n[i]); writeln(); writeln(); for i:=1 to k do write(' ЧЕТНЫЕ',c[i]); end.
const n=10;
var a,b,c: array [1..n] of integer;
x,y,z,k: integer;
begin
y:=0;
z:=0;
for x:=1 to n do begin
a[x]:=random(100)+1;
if a[x] mod 2=0 then begin
inc(y);
b[y]:=a[x];
end
else begin
inc(z);
c[z]:=a[x];
end;
write(a[x]:4);
end;
writeln;
k:=y;
for y:=1 to k do
write(b[y]:4);
writeln;
k:=z;
for z:=1 to k do
write(c[z]:4);
end.
var i,k,z:integer;
m:array[1..100] of integer;
c:array[1..100] of integer;
n:array[1..100] of integer;
begin
randomize;
for i:=1 to 10 do
begin
m[i]:=random(1000);
if m[i] mod 2 =0 then
begin
k:=k+1;
c[k]:=m[i];
end
else
begin z:=z+1;
n[z]:=m[i];
end;
end;
for i:=1 to z do
write(' НЕЧЕТНЫЕ',n[i]);
writeln();
writeln();
for i:=1 to k do
write(' ЧЕТНЫЕ',c[i]);
end.