var
NumberCount : array[0..50] of integer;
Numbers : array[0..50] of integer;
Procedure TForm1.SelectNumber;
var
inum,iValue,j,k : integer;
str,strsub:string;
begin
for k := 0 to 50do
begin
NumberCount[k] := 0;
end;
for j := 1 to 50do
begin
for inum := 0 to 50do
begin
repeat
iValue := Random(50) + 1;
until NotExistNum(iValue);
Numbers[inum] := iValue;
end;
end;
end;
Function TForm1.NotExistNum(inumv:integer):boolean;
var
i :integer;
begin
Result := True;
for i := 0 to 50do
begin
if Numbers = inumv then
Result:=false;
end;
end;
不知道符不符合你的要求