题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
var readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const list = []; //处理输入 rl.on("line", (line) => { let re=/[a-zA-z]/; if(line.match(re)){ list.push(line); } }); //处理输出 rl.on('close',()=>{ console.log(list.sort().join('\n')); })