题解 | 多组_A+B_T组形式

多组_A+B_T组形式

https://www.nowcoder.com/practice/cc937d32225340469bfb60a0797bad77

const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;

void async function () {
    let firstLine = await readline()//iterator迭代器第一次运行后, 停在第二行的起始处
    let t = parseInt(firstLine);
    for (let i = 0; i < t; i++) {
        let line = await readline();
        let tokens = line.trim().split(' ').filter(item => item !== ' ');
        let a = parseInt(tokens[0]);
        let b = parseInt(tokens[1]);
        console.log(a + b)
    }
}()

全部评论

相关推荐

大愣子衰哥:老哥,是正式还是实习
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务