function rot13(str) { var codetemp = 0; for(var i = 0;i < str.length;i++) {
codetemp = Number(str.charCodeAt(i)); if(codetemp >= 65 && codetemp <= 77) {
codetemp += 13;
}
else if(codetemp >= 78 && codetemp <= 90) {
codetemp -= 13;
}
str[i] = String.fromCharCode(codetemp);
} return str;
}
rot13("SERR PBQR PNZC");
這段代碼為什么總是報(bào)這個(gè)錯(cuò)誤?
慕仙森
2018-08-10 09:10:48