Если вам нужно на паскале, то ловите. Числа в массив выпадают рандомно. Диапазон (-50, 50): var mass: Array[1..30] of real; i, j: integer; isE: boolean; begin randomize; isE := true; for i := 1 to 30 do begin mass[i] := random (100) - 50; end; for i := 1 to 30 do begin writeln('mass[', i, '] = ', mass[i]); end;
for i := 1 to 30 do begin for j := 1 to 30 do begin if i <> j then begin if mass[i] = mass[j] then begin writeln('Массив не уникален!'); isE := false; end; end; end; end; if isE = true then writeln('Массив уникален!');
var mass: Array[1..30] of real;
i, j: integer;
isE: boolean;
begin
randomize;
isE := true;
for i := 1 to 30 do begin
mass[i] := random (100) - 50;
end;
for i := 1 to 30 do begin
writeln('mass[', i, '] = ', mass[i]);
end;
for i := 1 to 30 do begin
for j := 1 to 30 do begin
if i <> j then begin
if mass[i] = mass[j] then begin
writeln('Массив не уникален!');
isE := false;
end;
end;
end;
end;
if isE = true then writeln('Массив уникален!');
end.