使用while循环实现输出2-3+4-5+6...+100 的和;
a = 1 b = 0 while a< 100: a +=1 if a%2 == 0: b = b+a else: b = b-a print(b)
原文地址:https://www.cnblogs.com/riling/p/10068823.html
时间: 2024-11-03 17:21:15
使用while循环实现输出2-3+4-5+6...+100 的和;
a = 1 b = 0 while a< 100: a +=1 if a%2 == 0: b = b+a else: b = b-a print(b)
原文地址:https://www.cnblogs.com/riling/p/10068823.html