- UID
- 14878
注册时间2006-6-4
阅读权限30
最后登录1970-1-1
龙战于野
该用户从未签到
|
楼主 |
发表于 2006-8-30 18:01:00
|
显示全部楼层
秋风,真的不知说他啥好,竟然把我的考核题作废,:L
现在把答案公布下:
- function Caster_Enc(const str:string):string; //加密
- var sBox1,sBox2:String;
- i:Integer;
- begin
- sBox1 := 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
- sBox2 := 'defghijklmnopqrstuvwxyzabc DEFGHIJKLMNOPQRSTUVWXYZABC0987654321';
- Result := '';
- For i := 1 to Length(str) do
- begin
- Result := Result + sBox2[Pos(str[i],sBox1)];
- end;
- end;
- function Caster_Dec(const str:string):string; //解密
- var sBox1,sBox2:String;
- i:Integer;
- begin
- sBox1 := 'defghijklmnopqrstuvwxyzabc DEFGHIJKLMNOPQRSTUVWXYZABC0123456789';
- sBox2 := 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ0987654321';
- Result := '';
- For i := 1 to Length(str) do
- begin
- Result := Result + sBox2[Pos(str[i],sBox1)];
- end;
- end;
复制代码 |
|