function PassWordDeCode(password: string): string;
//Function PassWordDeCode(password As String) As String
var
  is_out: string;
//    Dim is_out As String
  il_x, il_y, il_len, i, il_bit: LongInt;
//    Dim il_x, il_y, il_len, i, il_bit As Long  j: Integer;
begin
  il_len := Length(password);
//    il_len = Len(password)
  il_x := 0;
//    il_x = 0
  il_y := 0;
//    il_y = 0
  is_out := '';
//    is_out = ""
  for J := 1 to il_len div 2 do begin
    i := j * 2 - 1;
//    For i = 1 To il_len Step 2
    il_bit := Ord(password[I]);
//        il_bit = AscW(Mid(password, i, 1))
    il_y := (il_bit - 64) * 16;
//        '取前4位值
//        il_y = (il_bit - 64) * 16//        '取后4位值
//        'dd = AscW(Mid(password, i + 1, 1)) - 64    il_y := il_y + Ord(password[i + 1]) - 64;
//        il_y = il_y + AscW(Mid(password, i + 1, 1)) - 64    is_out := is_out + Chr(il_y);
//        is_out = is_out & ChrW(il_y)
  end;  il_x := 0;
//    il_x = 0
  il_y := 0;
//    il_y = 0
  password := is_out;
//    password = is_out
  is_out := '';
//    is_out = ""
  il_len := Length(password);
//    il_len = Len(password)
  il_x := Ord(password[il_len]);
//    il_x = AscW(Mid(password, il_len, 1))  for i := (il_len - 1) downto 1 do begin
//    For i = (il_len - 1) To 1 Step -1
    il_y := il_x * 256 + Ord(password[I]);
//        il_y = il_x * 256 + AscW(Mid(password, i, 1))
    il_x := il_y mod 13;
//        il_x = il_y Mod 13
    is_out := Chr(il_y div 13) + is_out;
//        is_out = ChrW(Fix(il_y / 13)) & is_out
   end;
//    Next
  PassWordDeCode := is_out;
//    PassWordDeCode = is_out
end;
//End Function

解决方案 »

  1.   

    function PassWordDeCode(password: string): string;
    var
      il_x, il_y, il_len, I, il_bit: Integer;
    begin
      Result := '';
      for I := 1 to Length(password) div 2 do begin
        il_bit := Ord(password[I * 2 - 1]);
        il_y := (il_bit - 64) * 16;
        il_y := il_y + Ord(password[I * 2 ]) - 64;
        Result := Result + Chr(il_y);
      end;
      password := Result;
      Result := '';
      il_len := Length(password);
      il_x := Ord(password[il_len]);
      for i := (il_len - 1) downto 1 do begin
        il_y := il_x * 256 + Ord(password[I]);
        il_x := il_y mod 13;
        Result := Chr(il_y div 13) + Result;
      end;
    end;
      

  2.   

    Function PassWordDeCode(password : String): String;
    var 
       is_out:String;
       il_x, il_y, il_len, i, il_bit: Long;
    begin
       il_len := Length(password);
       il_x := 0;
       il_y := 0;
       is_out := '';
       For i = 1 To il_len do begin
            i := i*2; 
            il_bit := ord(char(copy(password, i, 1)));
            '取前4位值
            il_y := (il_bit - 64) * 16;
            '取后4位值
            'dd := ord(char(copy(password, i + 1, 1))) - 64;
            il_y := il_y + ord(char(copy(password, i + 1, 1))) - 64;
            is_out := is_out + Char(il_y);
        end    il_x := 0;
        il_y := 0;
        password := is_out;
        is_out := ''    il_len = Length(password);
        il_x = ord(char((copy(password, il_len, 1)));    For i = (il_len - 1) To 1 do begin
            il_y = il_x * 256 + char(copy(password, i, 1))
            il_x = il_y Mod 13
            is_out = char(int(il_y / 13)) + is_out
        end;
        PassWordDeCode := is_out
    End ////没有测试,自己试试,不对的话,再说
      

  3.   

    to zswangII(伴水II)(需要充充电)(副本) 
    非常感谢你给我了正确的答案,但同时我也非常抱歉,由于我是第一次给别人加分,结果不小心
    把分给错了,给了m_leaner(m_kk),我也没有式m_leaner(m_kk)的答案是否正确,不管怎样我非常感谢你,如果还有其他给贴子加分的办法请告诉我,我再给你加上!!