标签:lse else count pre 输出 int while div span
count=1 s = 0 while count<101: temp=count%2 if temp==0: s=s-count else: s=s+count count=count+1 print(‘100以内1-2+3-4+...+99-100和为:‘,s) print(‘-----end-----‘)
输出结果为:
100以内1-2+3-4+...+99-100和为: -50
-----end-----
标签:lse else count pre 输出 int while div span
原文地址:https://www.cnblogs.com/nmke/p/10162220.html