bigWeb/node/p1 #192
Replies: 1 comment
-
支持支持 手动写两行模版其实和 py 差不多,还可以重定向文件流到 stdin,类似 c 的 const f = require('fs').createReadStream('1.txt')
const rl = require("readline").createInterface({input: process.stdin /* f */});
const readline = () => new Promise(res => rl.on('line', res))
void async function () {
// Write your code here
while (line = await readline()) {
let tokens = line.split(' ');
let a = parseInt(tokens[0]);
let b = parseInt(tokens[1]);
console.log(a + b);
}
}() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
bigWeb/node/p1
粥里有勺糖的个人博客,记录随笔与学习笔记,大前端相关的知识,高频面试题,个人面经等
https://sugarat.top/bigWeb/node/p1.html
Beta Was this translation helpful? Give feedback.
All reactions