AcWing 608. 差
原题链接
简单
作者:
L-China
,
2023-01-05 19:54:49
,
所有人可见
,
阅读 313
JS
写法1:
let fs = require('fs');
let buf = '';
process.stdin.on('readable', function() {
let chunk = process.stdin.read();
if (chunk) buf += chunk.toString();
});
process.stdin.on('end', function() {
let [a, b, c, d] = buf.split('\n').map(x => {return parseInt(x)});
console.log(`DIFERENCA = ${a * b - c * d}`);
});
写法2:
let fs = require('fs');
let buf = '';
process.stdin.on('readable', function() {
let chunk = process.stdin.read();
if (chunk) buf += chunk.toString();
});
process.stdin.on('end', function() {
let q = buf.split('\n');
let a = parseInt(q[0]), b = parseInt(q[1]), c = parseInt(q[2]), d = parseInt(q[3]);
console.log("DIFERENCA = " + (a * b - c * d));
});
怎么开始氵了?
hh,没有没有,不过是学到 js 记录一下而已(ง •_•)ง