function rot13(str) { // LBH QVQ VG! var newStr = ""; for(var i=0; i<str.length; i++) { var char = str.charCodeAt(i); if(char<65 && char>90) { char = char; } else if(char < 78) { char += 13; } else { char -= 13; } newStr += String.fromCharCode(char); } return newStr;}// Change the inputs below to testrot13("SERR PBQR PNZC");//"FREE-CODE-CAMP" 想得到"FREE CODE CAMP",该如何改动
添加回答
举报
0/150
提交
取消