请求出1-2+3-4+5.......100 求和

n=1
s=0
while n<101:
    temp = n % 2
    if temp==0:
        s=s-n
    else:
        s=s+n
    n=n+1
print(s)
原文地址:https://www.cnblogs.com/huangjinshan/p/8047395.html