题解 | #等差数列#
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
1.先创造等差数列
2.然后把等差数列累加
n = int(input()) init = 2 interval = 3 res = 0 for each in range(2, 2 + n * interval, interval): res += each print(res)
等差数列
http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
n = int(input()) init = 2 interval = 3 res = 0 for each in range(2, 2 + n * interval, interval): res += each print(res)
相关推荐