const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.on('line', function (line) { const compute = line.replace('{','(').replace('}',')') console.log(eval(compute)) }); eval是个好东西