更新时间:2022-05-20 02:07:59
function rot13(str) { let temp = ''; for (let v of str) { if (v.charCodeAt() < 65 || v.charCodeAt() > 90) { temp = temp + v } else { if (v.charCodeAt()-13 < 65) { temp = temp + String.fromCharCode(91 - (65 - v.charCodeAt() + 13)) } else { temp = temp + String.fromCharCode(v.charCodeAt()-13) } } } temp return temp; } rot13("SERR CVMMN!"); 复制代码