3 Star 6 Fork 6

xyf007/namerena_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
calc_2_ordered_Chinese_characters.html 598 Bytes
一键复制 编辑 原始数据 按行查看 历史
xyf007 提交于 2020-10-25 14:26 +08:00 . use ESLint.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>
&#x4E24;&#x4F4D;&#x987A;&#x5E8F;&#x6C49;&#x5B57;&#x6D4B;&#x53F7;&#x91CF;&#x7EDF;&#x8BA1;
</title>
</head>
<body>
<script>
const s = prompt('名字');
let cntName1 = s[0].charCodeAt();
let cntName2 = s[1].charCodeAt();
if (cntName1 <= 0x4DB5) {
cntName1 -= 0x3400;
} else {
cntName1 -= 0x4E00 - 6582;
}
if (cntName2 <= 0x4DB5) {
cntName2 -= 0x3400;
} else {
cntName2 -= 0x4E00 - 6582;
}
document.write(cntName1 * 27522 + cntName2);
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xyf0076/namerena_scripts.git
git@gitee.com:xyf0076/namerena_scripts.git
xyf0076
namerena_scripts
namerena_scripts
master

搜索帮助