nodejs/es6题解,字符串排序
//设置输入流 const rl = require('readline').createInterface({ input: process.stdin, output: process.stdout }); //换行事件引发数据处理 rl.on('line', function (line) { let args = line.trim().split(' '); deal(args); }); function deal(args){ args.sort(); let strOut = ''; args.forEach((a)=>{ strOut += (a + ' '); }) strOut = strOut.trim(); console.log(strOut); count = 0; }