题解 | 尼科彻斯定理

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

void async function () {
    // Write your code here
    const num = await readline()
    let start = num * (num - 1) + 1
    const res = [start]
    for(let i=1; i<num; i++) {
       start += 2
       res.push(start)
    }
   console.log(res.join("+"))
}()

全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务