将一个字符串str的内容颠倒过来,并输出。
数据范围:
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void async function () { // Write your code here while(line = await readline()){ let arr = line.split('') console.log(arr.reverse().join('')) } }()
console.log(readline().split('').reverse().join(''))JavaScript(V8 6.0.0)
process.stdin.resume(); process.stdin.setEncoding('utf-8'); let input = ''; process.stdin.on('data',(data)=>{ input += data; }); process.stdin.on('end',()=>{ let inputArry = input.split('\n'); let arr = inputArry[0].split(""); console.log(arr.reverse().join("")); process.exit(); })