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