Skip to content

HJ11 数字颠倒

题目描述

image-20220208163657951

示例

image-20220208163706106

代码

js
// 接收输入,使用node的readerline
const readline = require('readline')
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
})

// 监听输入事件,回车时触发回调
rl.on('line', function (line) {
    let str = line.split('').reverse().join('')
    console.log(str);
});

题目来源

HJ11 数字颠倒