# 使用While循环实现输出2-3+4-5+6...+100的和。
number = 2
total = 0
while number <= 100:
if number % 2 == 0:
total += number
elif number % 2 == 1:
total -= number
number += 1
print("the sum is %s." % total)
# 使用While循环实现输出2-3+4-5+6...+100的和。
number = 2
total = 0
while number <= 100:
if number % 2 == 0:
total += number
elif number % 2 == 1:
total -= number
number += 1
print("the sum is %s." % total)