- UID
- 14878
注册时间2006-6-4
阅读权限30
最后登录1970-1-1
龙战于野

该用户从未签到
|
发表于 2007-1-26 17:05:26
|
显示全部楼层
我朋友说这样,兄弟试试~~
procedure TForm1.Button1Click(Sender: TObject);
const
c1 = $2927907884;
c2 = $1347682640;
c3 = $3902063717;
var
s1,s6, X, Y: LongWord;
Cnt: Integer;
begin
//ShowMessage(IntToStr(High(LongWord)));
X := High(LongWord) div 2;
Cnt := 0;
Y := 0;
for s1 := 0 to X do
begin
for s6 := X downto 0 do
begin
if ((((s1 xor s6) and c2) xor s1)=c1) and
((((s6 xor s1) and c2) xor s6)=c3) then
begin
Memo1.Lines.Add(inttostr(s1)+'-'+inttostr(s6));
Inc(Cnt);
end;
end;
Inc(Y);
Caption := IntToStr(Y * 100 div X) + '%';
Application.ProcessMessages;
end;
ShowMessage(IntToStr(Cnt));
end; |
|