不错不错!学习,偶也写一个
procedure TForm1.Button3Click(Sender: TObject);
var i:integer;
s,tmp:string;
begin
s:='';
i:=0;
while i<10 do
begin
randomize;
tmp:=intToStr(Random(100)+1);
if s='' then
begin
s:=tmp;
i:=i+1;
continue;
end;
if pos(tmp,s)=0 then
begin
s:=s+','+tmp;
i:=i+1;
end;
end;
showmessage(s);
end;