def qh(n): s , f = 0,1 for i in range(1,n+1): s += f * i f = -f return s print(qh(4))
复制链接后可在微信、QQ、小红书等平台粘贴分享;答案与解析在题目页。