Var ar:array[1..10] of integer; ar2:array[1..10] of integer; c,i,k:integer; begin; randomize; readln(c); writeln('First array:'); for i:=1 to 10 do begin; ar[i]:=random(10); write(ar[i]:4); if ar[i]<>c then begin; inc(k); ar2[k]:=ar[i]; end; end; writeln; writeln('Final array:'); for i:=1 to k do write(ar2[i]:4); end.
ar2:array[1..10] of integer;
c,i,k:integer;
begin;
randomize;
readln(c);
writeln('First array:');
for i:=1 to 10 do
begin;
ar[i]:=random(10);
write(ar[i]:4);
if ar[i]<>c then
begin;
inc(k);
ar2[k]:=ar[i];
end;
end;
writeln;
writeln('Final array:');
for i:=1 to k do
write(ar2[i]:4);
end.