Hex(abcdefg)=a6+ b6+ c6+ d6+ e6+ f6+ g6
有什么最快的方法
2006-08-28 09:50
是指7位数的10进制,能不能写一下穷举的方法
2006-08-28 10:52
2006-08-28 13:01
是指10进制数字的6次方,也就是将数字的ASCII减30H后再6次方,比如6的6次方为44580H.
2006-08-28 15:22
对.
2006-08-28 16:06
应该从1000000-9999999之间搜索吧,从1开始范围也太广了.如果方便,贴出代码看看.
2006-08-29 07:09
用DELPHI写了一个:
function cacl(a: integer): integer; //求六次方的函数
var
b:integer;
begin
asm
xor eax,eax
xor esi,esi
mov eax,a
mov ecx,eax
mov esi,$6
@:
imul eax,ecx
dec esi
jne @
mov b,eax
end;
Result := b;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
s,i:integer;
c:string;
d:string;
begin
for i := 1000000 to 9999999 do
begin
d:=inttostr(i);
s1:=cacl(strtoint(midstr(d,1,1)));
s2:=cacl(strtoint(midstr(d,2,1)));
s3:=cacl(strtoint(midstr(d,3,1)));
s4:=cacl(strtoint(midstr(d,4,1)));
s5:=cacl(strtoint(midstr(d,5,1)));
s6:=cacl(strtoint(midstr(d,6,1)));
s7:=cacl(strtoint(midstr(d,7,1)));
s:=s1+s2+s3+s4+s5+s6+s7;
if s=i then break ;
edit1.Text:=inttostr(i);
end;
end;
end.
不知道行不行,但是计算奇慢.
[此贴子已经被作者于2006-8-29 11:22:15编辑过]
2006-08-29 11:16
已经搞定:
1741725
4210818
9800817
9926315
[此贴子已经被作者于2006-8-29 12:21:45编辑过]
2006-08-29 11:54
.谢谢你的热心帮忙,你的那段代码写的非常好,而且速度很快.[此贴子已经被作者于2006-8-29 14:45:03编辑过]
2006-08-29 14:25