实现1*2+3*4+5*6+7*8...+99*100

total = 0
x = 1
y = 2
while y <= 100:
    total += x * y
    x += 2
    y += 2

print(total)

 

posted on 2017-06-28 23:06  裤裆内隐藏杀气  阅读(985)  评论(0编辑  收藏  举报

导航