Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
95186 汤弘毅 13求1+2-3+4-5+……n的值 Python3 Accepted 37 MS 3772 KB 110 2024-10-27 09:42:49

Tests(10/10):


Code:

n=int(input()) s=1 for x in range(2,n+1): if x%2==0: s=s+x else: s=s-x print(s)