Const nx = 50; Var A,B,D:array[1..nx]of integer; i,n,j,m,z,k,m1:integer; Begin WriteLn('Введи количество элементов массива'); Read(n); For i:= 1 to N do begin A[i]:= random(20)-5;write(A[i]:3);end;writeln; For i:= 1 to N do begin z:= A[i];k:=0; For j:= i+1 to N do if A[i] = A[j] then k:= k +1; For j:= 1 to m do if A[i] = B[j] then k:= k +1; For j:= 1 to m1 do if A[i] = D[j] then k:= k +1; if k = 0 then begin m:= m + 1; B[m] := z;end else begin m1:= m1 + 1; D[m1] := z;end; end;writeln('B'); For i:= 1 to m do write(B[i]:3); end.
Var A,B,D:array[1..nx]of integer; i,n,j,m,z,k,m1:integer;
Begin
WriteLn('Введи количество элементов массива'); Read(n);
For i:= 1 to N do begin
A[i]:= random(20)-5;write(A[i]:3);end;writeln;
For i:= 1 to N do begin
z:= A[i];k:=0;
For j:= i+1 to N do
if A[i] = A[j] then k:= k +1;
For j:= 1 to m do
if A[i] = B[j] then k:= k +1;
For j:= 1 to m1 do
if A[i] = D[j] then k:= k +1;
if k = 0 then begin
m:= m + 1; B[m] := z;end
else begin m1:= m1 + 1; D[m1] := z;end;
end;writeln('B');
For i:= 1 to m do write(B[i]:3);
end.