作业

#1-2+3-4...+99除88以外的所有数的总和
cum = 0
count = 0
while count < 99:
    count += 1  #输出1-99
    #print(count)
    if count == 88:
        continue
    if count % 2 == 0:
        cum -= count
    else:
        cum += count
print(cum)

 

posted @ 2019-02-13 10:11  ChenGouDa  阅读(85)  评论(0编辑  收藏  举报