|
发表于 2024-8-24 19:42:06
|
显示全部楼层
浙江省温州市
除了其他人提到的丢失了,这段代码本身也有bug,你直接翻译过去是运行不了的。需要修正下标越界的问题:
窗口程序集名 | 保 留 | 保 留 | 备 注 | 窗口程序集_启动窗口 | | | |
|
string_to_hex | 字节型 | | |
string1 | 字节型 | | | | string2 | 字节型 | | | | 如果 (string1 ≥ 65 且 string1 ≤ 70 )hex = string1 - 55 如果真 (string1 ≥ 48 且 string2 ≤ 57 )hex = string1 - 48 hex = hex × 16如果 (string2 ≥ 65 且 string2 ≤ 70 )hex = hex + string2 - 55 如果真 (string2 ≥ 48 且 string2 ≤ 57 )hex = hex + string2 - 48 返回 (hex)|
calculate | | | |
text | 文本型 | | | | ID | 文本型 | | | | S60ID | 文本型 | | | | S61ID | 文本型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | num | 整数型 | | | i | 整数型 | | | in_array | 字节集 | | | result_array | 字节集 | | | out_array | 字节集 | | | ascii_array | 字节集 | | | length | 整数型 | | | quotient | 字节型 | | | remainder | 字节型 | | | A | 整数型 | | | B | 整数型 | | |
ascii_array = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70 }num = 1 in_array = 到字节集 (text ) + { 0 }out_array = 取空白字节集 (100 )result_array = 取空白字节集 (50 )length = 取字节集长度 (in_array )i = 0 判断循环首 (i × 2 + 1 ≤ length )如果真 (in_array [i × 2 + 1 ] ≠ 0 )result_array [num ] = string_to_hex (in_array [i × 2 + 1 ], in_array [i × 2 + 2 ])num = num + 1 i = i + 1判断循环尾 ()num = num - 1 变量循环首 (1, num, 1, i )out_array [i ] = 位取反 (result_array [i ])变量循环首 (1, (i - 1 ) % 8, 1, )如果 (位与 (out_array [i ], 128 ) = 128 )out_array [i ] = 位或 (左移 (out_array [i ], 1 ), 1 )out_array [i ] = 左移 (out_array [i ], 1 )变量循环尾 ()quotient = out_array [i ] ÷ 8 remainder = out_array [i ] % 8 out_array [i ] = 左移 (remainder, 5 ) + quotient 如果真 (位与 (out_array [i ], 128 ) = 128 且 位与 (out_array [i ], 1 ) = 0 )out_array [i ] = 位异或 (out_array [i ], 86 )如果真 (位与 (out_array [i ], 128 ) = 0 且 位与 (out_array [i ], 1 ) = 1 )out_array [i ] = 位异或 (out_array [i ], 106 )A = 右移 (位与 (out_array [i], 96), 4)B = 左移 (位与 (out_array [i ], 6 ), 4 )out_array [i ] = 位与 (out_array [i ], 153 )out_array [i ] = 位或 (位或 (out_array [i ], A ), B )变量循环尾 ()计次循环首 (num, i )ID = ID + 字符 (ascii_array [out_array [i ] ÷ 16 + 1 ])ID = ID + 字符 (ascii_array [out_array [i ] % 16 + 1 ])计次循环尾 ()S60ID = S60ID + 字符 (ascii_array [83 ÷ 16 + 1 ])S60ID = S60ID + 字符 (ascii_array [83 % 16 + 1 ])S60ID = S60ID + 字符 (ascii_array [54 ÷ 16 + 1 ])S60ID = S60ID + 字符 (ascii_array [54 % 16 + 1 ])S61ID = S60ID S60ID = S60ID + 字符 (ascii_array [48 ÷ 16 + 1 ])S60ID = S60ID + 字符 (ascii_array [48 % 16 + 1 ])S60ID = S60ID + ID S61ID = S61ID + 字符 (ascii_array [49 ÷ 16 + 1 ])S61ID = S61ID + 字符 (ascii_array [49 % 16 + 1 ])S61ID = S61ID + ID 变量名 | 类 型 | 静态 | 数组 | 备 注 | ID | 文本型 | | | S60ID | 文本型 | | | S61ID | 文本型 | | | calculate (“55555”, ID, S60ID, S61ID )调试输出 (“输出的ID: ” + ID )调试输出 (“加 'S60' 前缀的ID: ” + S60ID )调试输出 (“加 'S61' 前缀的ID: ” + S61ID )
|
评分
-
参与人数 1 | 荣誉 +1 |
收起
理由
|
笨潴
| + 1 |
热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻! |
查看全部评分
|