题解 | #牛牛学数列4#
牛牛学数列4
https://www.nowcoder.com/practice/586b114f52034688879342ba45779081
n = int(input()) sum = 0 for i in range(1,n+1): sum += (i+1)*i/2 print(int(sum))
牛牛学数列4
https://www.nowcoder.com/practice/586b114f52034688879342ba45779081
n = int(input()) sum = 0 for i in range(1,n+1): sum += (i+1)*i/2 print(int(sum))
相关推荐