题解 | #单词倒排#

单词倒排

http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836

const readline = require('readline');
const rl = readline.createInterface({
    input:process.stdin,
    output:process.stdout
});
rl.on('line',(line)=>{
    let str = line;
    console.log(str.match(/[a-zA-Z]+/g).reverse().join(' '))
        // console.log(str.split(/[^a-zA-Z]+/).reverse().join(' '))
})

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务