//改写 levi 的代码 测试通过
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm1 = class(TForm)
Memo1: TMemo;
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Procedure assemble(var Ret:TStrings);
var
Form1: TForm1;
implementation
{$R *.dfm}
Procedure assemble(var Ret:TStrings);
var
i,j,l,p,k:integer;
CurNum,AllNum:String;
begin
for I:=123 to 456 do
begin
AllNum:='123456';
CurNum:=IntToStr(i); //123
if pos(CurNum[2],AllNum) =0 then continue;
if pos(CurNum[3],AllNum) =0 then continue;
AllNum[StrToInt(CurNum[1])] := ' ';
if AllNum[StrToInt(CurNum[2])] <> ' ' then
AllNum[StrToInt(CurNum[2])] := ' '
else
Continue;
if AllNum[StrToInt(CurNum[3])] <> ' ' then
AllNum[StrToInt(CurNum[3])] := ' '
else
Continue;
Ret.add(CurNum);
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
Ret:TStrings;
begin
Ret:=TStringList.Create;
assemble(Ret);
Memo1.Lines := Ret;
end;
end.