A = input()
N = input()
ls1 = []
if 1<=int(A)<=9 and 0<=int(N):
for i in range(1, int(N)+1):
ls1.append(int(A*i))
# print(ls1)
print(sum(ls1))
else:
print('data error')
数列求和python
最新推荐文章于 2023-09-01 21:57:51 发布