题解 | #等差数列#
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
let str; // 值为index*3-1 while(str = parseInt(readline())){ let sum = 0; for(let i = 1;i<=str;i++){ sum += i*3-1 } console.log(sum) }
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
let str; // 值为index*3-1 while(str = parseInt(readline())){ let sum = 0; for(let i = 1;i<=str;i++){ sum += i*3-1 } console.log(sum) }
相关推荐