Var ar: array[1..10000]of integer;
ms: array[1..10000]of integer;
i, c, n, j, p: integer; b: boolean;
begin
randomize;
b := true;
c := 1;
write('Введите количество элементов массива:');
read(n);
writeln('Массив:');
for i := 1 to n do ms[i] := -2147483648;
for i := 1 to n do begin ar[i] := random(11); write(ar[i], ' '); end;
for i := 1 to n do
for j := i + 1 to n do
begin
if (ar[i] = ar[j]) then
begin
for p := 1 to c do
if (ar[i] = ms[p]) then b := false;
if (b = true) then begin ms[c] := ar[i]; c := c + 1; end;
end;
b := true;
end;
writeln;
if (c = 1) then write('Нет')
else
begin
write('Есть:');
for i := 1 to c - 1 do if(i <> c - 1) then write(ms[i], ',') else write(ms[i]);
end;
end.