以下代码不知是否符合你的要求:
procedure TForm1.Button1Click(Sender: TObject);
function MakeNum(DigSList:TStringList):Integer;
var i:integer;
s:string;
begin
s:='';
for i:=0 to DigSList.Count-1 do
s:=s+DigSList.Strings;
Result:=strtoint(s);
end;
var
P1,P2,P:TStringList;
N1,N2,i,j,k,m,n,o:Integer;
begin
P1:=TStringList.Create;
P2:=TStringList.Create;
P:=TStringList.Create;
P1.CommaText:='1,3,5,7,9';
P2.CommaText:='0,2,4,6,8';
for i:=0 to P1.Count-1 do
for j:=0 to P1.Count-1 do
for k:=0 to P1.Count-1 do
for m:=1 to P2.Count-1 do
for n:=0 to P2.Count-1 do
for o:=0 to P2.Count-1 do
begin
P.Add(P1.Strings);P.Add(P1.Strings[j]);P.Add(P1.Strings[k]);
P.Add(P2.Strings[m]);P.Add(P2.Strings[n]);P.Add(P2.Strings[o]);
N1:=MakeNum(P);
N2:=strtoint(copy(inttostr(N1),4,6)+copy(inttostr(N1),1,3));
if N2=N1*5.5 then showmessage('这个数符合条件:'+inttostr(N1));
P.Clear;
end;
P1.Free;
P2.Free;
P.Free;
end;