Skip to content

HJ12 字符串反转

题目描述

image-20220208165855981

示例

image-20220208165902517

代码

js
let readline = require('readline')
let rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
})

// 监听输入,翻转字符串
rl.on('line', function (line){
    let str = line.split('').reverse().join('')
    console.log(str)
})

题目来源

HJ12 字符串反转