• + 0 comments
    var n = parseInt(readLine());
        var s = readLine();
        var k = parseInt(readLine());
        let finalString = ''
        for (let letter of s) {
          let letra = ''
          if (letter.match(/[a-z]/i)) {
            let asciiL = letter.charCodeAt(0)
            if (asciiL >= 65 && asciiL <= 90) {
              letra = String.fromCharCode(65 + (asciiL - 65 + k) % 26)
    
            }
            if (asciiL >= 97 && asciiL <= 122) {
              letra = String.fromCharCode(97 + (asciiL - 97 + k) % 26)
            }
          } else {
            letra = letter
          }
          finalString += letra
        }
        console.log(finalString)