本文整理自网络,侵删。
procedure TForm1.btn1Click(Sender: TObject);const Arr:array[1..10] of string[11]=('13622220001', '13622220002','13622220003','13622220004', '13622220005','13622220006','13622220007', '13622220008','13622220009','13622220010');var i:integer;begin Randomize; i := Trunc(10 * Random + 1); ShowMessage('当前随bai机抽取的号码du是:zhi'+Arr[i]);end;

另外一个;procedure TForm1.Button1Click(Sender: TObject);var arrInt: array[0..9] of Integer; i: Integer;begin Randomize;//随机bai i := Random(9);//随机产生du9以内zhi的dao数 arrInt[i] := i;end;
相关阅读 >>
Delphi gettempdirectory 获取临时文件夹路径
Delphi rest application 与 webbroker application 区别
更多相关阅读请进入《Delphi》频道 >>