|
发表于 2023-7-30 22:04:25
|
显示全部楼层
福建省宁德市
.....你这算法感觉效率不咋地不如我写的(滑稽
变量名 | 类 型 | 静态 | 数组 | 备 注 | return | 整数型 | | | Text | 文本型 | | 0 | Number | 整数型 | | 0 | Rule | 整数型 | | 17 | Check | 文本型 | | 11 | i | 整数型 | | | 文本_逐字分割 (sfz前17位, Text )文本数组转换整数数组 (Text, Number ) 如果真 (取数组成员数 (Number ) = 17 )  Rule = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 } 计次循环首 (17, i )  return = Number [i ] × Rule [i ] + return  计次循环尾 () Check = { “1”, “0”, “X”, “9”, “8”, “7”, “6”, “5”, “4”, “3”, “2” } 返回 (sfz前17位 + Check [return % 11 + 1 ])返回 (“”)|
文本数组转换整数数组 | | | |
Text | 文本型 | | | | Number | 整数型 | | | |
计次循环首 (取数组成员数 (Text ), i ) 加入成员 (Number, 到整数 (Text [i ])) 计次循环尾 ()
|
|