题解 | 多组_A+B_零尾模式

多组_A+B_零尾模式

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

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

void async function () {
    while(line = await readline()) {
        let tokens = line.trim().split(' ').filter(item => item !== '');
        let a = parseInt(tokens[0]);
        let b = parseInt(tokens[1]);
        if (a === 0 && b === 0) break;
        console.log(a + b);
    }
    process.exit();
}()

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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