PYTHON

Kinghero King of the summit 2021-10-10 13:59:47 2023-08-25 20:17:42 5
        x = input()
        x = int(x)
        s = 0
        for i in range(1, (x + 1)):
            s = (s + i)
        print(s)
{{ vote && vote.total.up }}

共 2 条回复

wcczw

程序要精简。

wcczw

可以写成:print(sum(list(range(1,int(input()+1)))))