方法转自牛客网
以a+b为例
V8
while(line=readline()){
var lines = line.split(' ');
var a = parseInt(lines[0]);
var b = parseInt(lines[1]);
print(a+b);
}
Node
var readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.on('line', function(line){
var tokens = line.split(' ');
console.log(parseInt(tokens[0]) + parseInt(tokens[1]));
});