这个函数 ( 积分: 50 )

  • 主题发起人 主题发起人 m911
  • 开始时间 开始时间
M

m911

Unregistered / Unconfirmed
GUEST, unregistred user!
begin
if Odd(i) then
tmpStr := HighCharChange[CharToID(tmpStr)]
else tmpStr := LowCharChange[CharToID(tmpStr)];
end;
 
function xxx(S: string): string;
var
i: Integer;
const
LowCharChange: array[0..15] of Char = ('9','8','B','A','D','C','F','E','1','0','3','2','5','4','7','6');
HighCharChange: array[0..15] of Char = ('8','9','A','B','C','D','E','F','0','1','2','3','4','5','6','7');
function CharToID(AChar: Char): Integer;
begin
Result := -1;
if AChar in ['0'..'9'] then
Result := StrToInt(AChar)
else if AChar in ['A'..'F'] then
Result := Ord(AChar) - Ord('A') + 10;
end;
begin
for i := 1 to Length(s) do
begin
if Odd(i) then
s := HighCharChange[CharToID(s)]
else s := LowCharChange[CharToID(s)];
end;
Result := RightStr(tmpStr, 2) + Copy(tmpStr, 5, 2) + Copy(tmpStr, 3, 2) + LeftStr(tmpStr, 2);
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
ShowMessage(xxx('F1836A8C'));
end;
 
问题解决了 谢谢
 
接受答案了.
 
后退
顶部