#计算s=12-22+32-42+…+972-982+992注意:本题不允许使用函数【1】foriin【2】ifi2!=0【3】#注1:要求使用复合算数运算符+=、-=、=、=等;注2:平方运算要使用else【4】prints
s = 0 for i in range(12, 1003, 10): if i % 20 == 2: s -= i else: s += i print(s)
原文地址: http://www.cveoy.top/t/topic/hhkK 著作权归作者所有。请勿转载和采集!