unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, math;type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);var i,ii, int:integer; str:string;begin Randomize; int:=Random(9999999999); str:= inttostr(int); if length(str)<> 10 then begin for i:=1 to 10-length(str) do str:='0'+str; end; for ii:=0 to memo1.Lines.Count do if str= memo1.Lines.Strings[ii] then exit; memo1.Lines.Add(str);end;end.