这么奇葩的需求,下面就是 a 的函数的反函数 function a(p:string):string; begin Result := Format('%x', [strtoint(p)]);end;function inva(p:string):string; begin Result := IntToStr( StrToInt('$'+p) ); end;procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(a(inva('112233'))); end;
如果是原来的样子,那意思就相当于“一个十进制数m,找一个十进制数n,要求A(n)=m”(A是你的函数)这样?
function a(p:string):string;
begin
Result := Format('%x', [strtoint(p)]);end;function inva(p:string):string;
begin
Result := IntToStr( StrToInt('$'+p) );
end;procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(a(inva('112233')));
end;