16,748
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
function UniqueStr(x:integer):boolean;
var s,tmp:string;
a:integer;
begin
Result:=true;
s:=inttostr(x);
for a:=1 to 6 do begin
tmp:=s;
delete(tmp,a,1);
if pos(s[a],tmp)>0 then exit;
end;
Result:=false;
end;
function MultipleMaxV(x:integer):boolean;
var b:integer;
begin
Result:=true;
for b:=2 to 6 do
if x*b>999999 then exit;
Result:=false;
end;
begin
for i:=102345 to 987654 do begin
if UniqueStr(i) then continue;
if MultipleMaxV(i) then continue
else begin
showmessage('符合题目要求的数是:"'+inttostr(i)+'"');
exit;
end;
end;
end;