q=0 a=2 while a<=100: # a+=1 if a%2==0: q+=a else: q-=a a+=1 print(q)
打印2-3+4-5+6....100的值是多少
原文:http://www.cnblogs.com/zhangzihong/p/6143633.html