题解 | #字符串排序#
字符串排序
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) => { list.push(line); //接收所有数据 if (Number(list[0]) === list.length - 1) { list.shift(); console.log(list.sort().join('\n'));//join-粘合成字符串 } });