主题:求一算法解释.谢谢了
f_mm1文件
global type f_mm1 from function_object
end type
forward prototypes
global function string f_mm1 (string as_mw)
end prototypes
global function string f_mm1 (string as_mw);integer li_1
integer li_2
integer i
integer j
string mw[]
string ls_temp
li_1 = len(as_mw)
li_2 = len(gs_key1[1])
j = li_1 / li_2
if j = li_1 / li_2 then
j = int(li_1 / li_2)
else
j = int(li_1 / li_2) + 1
end if
for i = 1 to j
mw[i] = mid(as_mw,1,li_2)
as_mw = mid(as_mw,li_2 + 1)
next
ls_temp = f_mm2(mw)
return ls_temp
end function
f_mm2文件
global type f_mm2 from function_object
end type
forward prototypes
global function string f_mm2 (string as_1[])
end prototypes
global function string f_mm2 (string as_1[]);integer i
integer j
integer asc1
integer asc2
integer mod1
string ls_temp
for i = 1 to upperbound(as_1)
for j = 1 to len(as_1[i])
if integer(fasc(mid(as_1[i],j,1),"-")) = 99
then
beep(1)
messagebox("提示","不是有效字
符!",stopsign!)
return ""
end if
asc1 = integer(fasc(mid(as_1[i],j,1),"-"))
asc2 = integer(fasc(mid(upper(gs_key1
[i]),j,1),"-"))
mod1 = mod(asc1 + asc2,36)
if mod1 = 0 then
mod1 = 36
end if
ls_temp = ls_temp + fasc(string(mod1),"+")
next
next
return f_mm3(ls_temp)
end function
f_mm3文件
global type f_mm3 from function_object
end type
forward prototypes
global function string f_mm3 (string as_mw)
end prototypes
global function string f_mm3 (string as_mw);integer i
integer j
string ls_1
string ls_2
for i = 1 to len(as_mw) step 2
ls_1 = ls_1 + mid(as_mw,i,1)
next
for j = 2 to len(as_mw) step 2
ls_2 = ls_2 + mid(as_mw,j,1)
next
return (ls_1 + ls_2)
end function
fasc文件
global type fasc from function_object
end type
forward prototypes
global function string fasc (string ac1,string as_lb)
end prototypes
global function string fasc (string ac1,string as_lb);string
axc[]
integer i
integer j
axc[1] = "x;"
axc[2] = "r;"
axc[3] = "m;"
axc[4] = "n;"
axc[5] = "l;"
axc[6] = "k;"
axc[7] = "?K"
axc[8] = "AK"
axc[9] = "BK"
axc[10] = "OK"
axc[11] = "KK"
axc[12] = "NK"
axc[13] = "<K"
axc[14] = "HK"
axc[15] = "IK"
axc[16] = "CK"
axc[17] = "FK"
axc[18] = "QK"
axc[19] = "=K"
axc[20] = "LK"
axc[21] = "EK"
axc[22] = ";K"
axc[23] = "MK"
axc[24] = "q;"
axc[25] = "GK"
axc[26] = "PK"
axc[27] = "XK"
axc[28] = "p;"
axc[29] = ">K"
axc[30] = "JK"
axc[31] = "DK"
axc[32] = "RK"
axc[33] = "w;"
axc[34] = "o;"
axc[35] = "ZK"
axc[36] = "WK"
if as_lb = "+" and ((integer(ac1) < 1) or (integer(ac1) >
36)) then
return "99"
end if
if as_lb = "+" then
return f_submi(axc[integer(ac1)],gs_key4)
end if
if as_lb = "-" then
for i = 1 to 36
if f_submi(axc[i],gs_key4) = ac1 then
j ++
return string(i)
end if
next
end if
if j = 0 then
return "99"
end if
end function
global type f_mm1 from function_object
end type
forward prototypes
global function string f_mm1 (string as_mw)
end prototypes
global function string f_mm1 (string as_mw);integer li_1
integer li_2
integer i
integer j
string mw[]
string ls_temp
li_1 = len(as_mw)
li_2 = len(gs_key1[1])
j = li_1 / li_2
if j = li_1 / li_2 then
j = int(li_1 / li_2)
else
j = int(li_1 / li_2) + 1
end if
for i = 1 to j
mw[i] = mid(as_mw,1,li_2)
as_mw = mid(as_mw,li_2 + 1)
next
ls_temp = f_mm2(mw)
return ls_temp
end function
f_mm2文件
global type f_mm2 from function_object
end type
forward prototypes
global function string f_mm2 (string as_1[])
end prototypes
global function string f_mm2 (string as_1[]);integer i
integer j
integer asc1
integer asc2
integer mod1
string ls_temp
for i = 1 to upperbound(as_1)
for j = 1 to len(as_1[i])
if integer(fasc(mid(as_1[i],j,1),"-")) = 99
then
beep(1)
messagebox("提示","不是有效字
符!",stopsign!)
return ""
end if
asc1 = integer(fasc(mid(as_1[i],j,1),"-"))
asc2 = integer(fasc(mid(upper(gs_key1
[i]),j,1),"-"))
mod1 = mod(asc1 + asc2,36)
if mod1 = 0 then
mod1 = 36
end if
ls_temp = ls_temp + fasc(string(mod1),"+")
next
next
return f_mm3(ls_temp)
end function
f_mm3文件
global type f_mm3 from function_object
end type
forward prototypes
global function string f_mm3 (string as_mw)
end prototypes
global function string f_mm3 (string as_mw);integer i
integer j
string ls_1
string ls_2
for i = 1 to len(as_mw) step 2
ls_1 = ls_1 + mid(as_mw,i,1)
next
for j = 2 to len(as_mw) step 2
ls_2 = ls_2 + mid(as_mw,j,1)
next
return (ls_1 + ls_2)
end function
fasc文件
global type fasc from function_object
end type
forward prototypes
global function string fasc (string ac1,string as_lb)
end prototypes
global function string fasc (string ac1,string as_lb);string
axc[]
integer i
integer j
axc[1] = "x;"
axc[2] = "r;"
axc[3] = "m;"
axc[4] = "n;"
axc[5] = "l;"
axc[6] = "k;"
axc[7] = "?K"
axc[8] = "AK"
axc[9] = "BK"
axc[10] = "OK"
axc[11] = "KK"
axc[12] = "NK"
axc[13] = "<K"
axc[14] = "HK"
axc[15] = "IK"
axc[16] = "CK"
axc[17] = "FK"
axc[18] = "QK"
axc[19] = "=K"
axc[20] = "LK"
axc[21] = "EK"
axc[22] = ";K"
axc[23] = "MK"
axc[24] = "q;"
axc[25] = "GK"
axc[26] = "PK"
axc[27] = "XK"
axc[28] = "p;"
axc[29] = ">K"
axc[30] = "JK"
axc[31] = "DK"
axc[32] = "RK"
axc[33] = "w;"
axc[34] = "o;"
axc[35] = "ZK"
axc[36] = "WK"
if as_lb = "+" and ((integer(ac1) < 1) or (integer(ac1) >
36)) then
return "99"
end if
if as_lb = "+" then
return f_submi(axc[integer(ac1)],gs_key4)
end if
if as_lb = "-" then
for i = 1 to 36
if f_submi(axc[i],gs_key4) = ac1 then
j ++
return string(i)
end if
next
end if
if j = 0 then
return "99"
end if
end function