测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A20966. 执行下面的 Python 代码,如果输入为大于 0 的整数,则输出一定为-N。( )N = int(input()) total = 0 for i in range(-N, N, 2): total += i print(total)

判断题 容易

题目描述

执行下面的 Python 代码,如果输入为大于 0 的整数,则输出一定为-N。(    )

N = int(input())
total = 0
for i in range(-N, N, 2):
    total += i
print(total)

选项(单选)

上一题 下一题