单选题

运行下面程序,输入5,输出的结果是(    )。

n = int(input())
a = 1
for i in range(2, n + 1):
    a = a + i
print(a)
A

12

B

15

C

18

D

21

赣ICP备20007335号-2