function DenCrypt(Str : string; Key : string): string;  var  X, Y : Integer;  A : Byte;  begin  if Key = '' then  Key := '123456';  Y := 1;  for X := 1 to length(Str) do begin  A := (ord(Str[X]) and $0f) xor (ord(Key[Y]) and $0f);  Str[X] := char((ord(Str[X]) and $f0) + A);  inc(Y);  if Y > length(Key) then  Y := 1;  end;  Result := Str;  end;

解决方案 »

  1.   

    不晓得《葵花宝典》?你练了葵花宝典了?惨!同情ing
      

  2.   

    String DenCrypt(String Str,String Key){
      int X,Y; byte A; StringBuffer SF;
      if (Key="")
         Key="123456";
         Y=1;
      for(X=1;X<Str.length();X++){
        A=(Str.charAt(X) & 0Xf) ^(Key.charAt(Y) & 0Xf);
        SF=new StringBuffer(Str);
        SF.setCharAt(X,(char)(Str.charAt(X) & 0Xf0)+A));
        Str:=SF.toString;
        Y++;
        if Y > length(Key) then
        Y := 1;
       if (Y>Key.length()) 
          Y=1;
      }
      return Str;
    }
    呼好累,大体应该没有错了。
      

  3.   

    看看JAVA的语法,然后一句句的翻译就行了阿只有个if 和 for很简单的
      

  4.   

    哎,一楼,学D,连《葵花宝典》都不知道HUBDOG的《传说中的DELPHI葵花宝典》简称《葵花宝典》
      

  5.   

    难道HUBDOG就是传说中的《东方不败》?
      

  6.   

    原来《葵花宝典》是用Delphi写的?
      

  7.   

    天啊,Delphi写成了《葵花宝典》。
    东方不败不就是咱们的祖师爷?
      

  8.   

    问一下,有没有Delphi的“九阴真经”,努力寻找ing……
      

  9.   

    linzhengqun(风) 有几处不太对!1.等于应该用 == 而不是 =
    2.字符串比较不能用= 而应该用 Str.compareTo()
    3.赋值要用 = 而不是 :=  //我相信这个是打错了!
      

  10.   

    本人只会Delphi和Java,刚好派上用场!嘻嘻!