题解 | #等差数列#
等差数列
https://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
while True: try: n = int(input()) sum = 2 for i in range(1, n): number = 2 + 3 * i sum += number print(sum) except: break
等差数列
https://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
while True: try: n = int(input()) sum = 2 for i in range(1, n): number = 2 + 3 * i sum += number print(sum) except: break
相关推荐