程序描述 1-2+3-4…966 其中,所有数字为整数,从1开始递增,奇数为正,偶数为负 具体实现 s = 0 for i in range(967): # range不包括最后一个,故此处不能写966而是要写967 s = s + i * pow(-1, i+1) print(s)