靈
靈鴿
Unregistered / Unconfirmed
GUEST, unregistred user!
给分吧。
Function GetNum(Max: Integer): String;
Var
T1: Array Of String;
I, J, L, T3, T5: integer;
T2: Boolean;
T4: String;
begin
SetLength(T1, Max);
For I := 0 To Max - 1do
begin
T1 := IntToStr(I + 1);
end;
Randomize;
T2 := True;
J := 0;
L := 0;
While T2do
begin
T3 := Random(Max * 2);
T3 := T3 Mod Max;
If T3 < Max then
begin
If T1[T3] <> '' then
begin
T4 := T4 + T1[T3];
If J < Max - 1 then
T4 := T4 + ',';
T1[T3] := '';
Inc(J);
end;
end;
Inc(L);
If L > Max * 10 then
T2 := False;
If J > Max then
T2 := False;
end;
Result := T4;
end;
Function GetNum(Max: Integer): String;
Var
T1: Array Of String;
I, J, L, T3, T5: integer;
T2: Boolean;
T4: String;
begin
SetLength(T1, Max);
For I := 0 To Max - 1do
begin
T1 := IntToStr(I + 1);
end;
Randomize;
T2 := True;
J := 0;
L := 0;
While T2do
begin
T3 := Random(Max * 2);
T3 := T3 Mod Max;
If T3 < Max then
begin
If T1[T3] <> '' then
begin
T4 := T4 + T1[T3];
If J < Max - 1 then
T4 := T4 + ',';
T1[T3] := '';
Inc(J);
end;
end;
Inc(L);
If L > Max * 10 then
T2 := False;
If J > Max then
T2 := False;
end;
Result := T4;
end;