输入输出太折腾了,先记录一下JS的输入输出,有两种,一种V8的,一种node的。

const readline = require('readline');
const rl = readline.createInterface({
    input:process.stdin,
    output:process.stdout
});
let arr = [];
let num = 0;
rl.on('line', function(line) {
    arr.push(line);
    if(Number(arr[0]) === arr.length - 1){
        arr.shift()
        arr.sort((a, b) => {
            return  a> b? 1: -1
        });
        arr.forEach((data) => {
            console.info(data);
        })
    }
//     
});