procedure TForm1.Button1Click(Sender: TObject);
var
I,j: Integer;
s:string;
begin
Randomize;
s:='';
i:=0;
while i<6do
begin
j:=random(10);
if pos(inttostr(j)+',',s)=0 then
begin
s:=s+inttostr(j)+',' ;
inc(i);
end;
end;
edit1.text:=s;
end;
//0~9的
procedure TForm1.Button1Click(Sender: TObject);
var
I:Integer;
Strat:Boolean;
begin
Randomize;
Strat:=True;
while Stratdo
begin
I:=random(999999);
If Length(IntToStr(I))=6 then
Strat:=False;
end;
ShowMessage(IntToStr(I));
end;