现在有300个员工,1--300的数
怎么样随机分配给这300个员工
并且每次启动的时候随机的数都不能相同procedure TForm1.Button1Click(Sender: TObject);
var i,a:integer;
var j,string1:string;
begin
memo1.Clear;
memo2.Clear;
a:=strtoint(edit1.Text);
for i:=0 to a-1 do begin
j:=inttostr(random(a)+1);
while memo1.Lines.IndexOf(j)>-1 do j:=inttostr(random(a)+1);
memo1.Lines.Add(j);
memo2.Text:=memo2.Text+'员工'+inttostr(i+1)+'--->'+j+#13#10;
这段代码我试了可以用
但是每次启动的时候它随机的数都是相同的