这第六题python实现最简单吧max1 = 100 sum1 = 0 sum2 = 0 for i in range(1,max1+1): sum1 += i**2 sum2 = ((1+max1)*max1/2)**2 print(sum2-sum1)