代码简化成功! const rl = require("readline").createInterface({ input: process.stdin, output: process.stdout }); rl.on('line', line => { let arr = [/[a-z]/ig, /\s/g, /[0-9]/g, /[^a-z0-9\s]/ig] for(let i = 0; i < arr.length; i++){ let res = line.match(arr[i]) ? line.match(arr[i]).join...