1个回答
2013-09-05
展开全部
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Timer1: TTimer;
Label5: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
vg_cou:Int64;
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
var
h,m,s:Integer;
begin
self.vg_cou:=self.vg_cou+1;
h:=self.vg_cou div 3600;
m:=self.vg_cou div 60;
s:=self.vg_cou mod 60;
self.Label5.Caption:=IntToStr(h)+':'+inttostr(m)+':'+inttostr(s);
end;procedure TForm1.Button2Click(Sender: TObject);
var
i,j,m,n:Integer;
s,ss,p:string;
begin
s:='abcdefghijklmnopqrstuvwxyz';
self.Timer1.Enabled:=False;
self.vg_cou:=0;
self.Timer1.Enabled:=true;
for i:=1 to 26 do
begin
p:=s[i];
for j:=2 to 26 do
begin
if j+7>26 then
continue;
ss:=p+copy(s,j,8);
if self.ListBox1.Items.IndexOf(ss)=-1 then
self.ListBox1.Items.Add(ss);
self.Label4.Caption:=IntToStr(self.ListBox1.Items.Count);
application.ProcessMessages;
end;
end;
end;end.
这个是不考虑排列顺序的
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Timer1: TTimer;
Label5: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
vg_cou:Int64;
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
var
h,m,s:Integer;
begin
self.vg_cou:=self.vg_cou+1;
h:=self.vg_cou div 3600;
m:=self.vg_cou div 60;
s:=self.vg_cou mod 60;
self.Label5.Caption:=IntToStr(h)+':'+inttostr(m)+':'+inttostr(s);
end;procedure TForm1.Button2Click(Sender: TObject);
var
i,j,m,n:Integer;
s,ss,p:string;
begin
s:='abcdefghijklmnopqrstuvwxyz';
self.Timer1.Enabled:=False;
self.vg_cou:=0;
self.Timer1.Enabled:=true;
for i:=1 to 26 do
begin
p:=s[i];
for j:=2 to 26 do
begin
if j+7>26 then
continue;
ss:=p+copy(s,j,8);
if self.ListBox1.Items.IndexOf(ss)=-1 then
self.ListBox1.Items.Add(ss);
self.Label4.Caption:=IntToStr(self.ListBox1.Items.Count);
application.ProcessMessages;
end;
end;
end;end.
这个是不考虑排列顺序的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询