m(n) = 1/2 + 2/3 + ... +n/n+1 def sljisuan(): s = 0 n = int(input("请输入需要求和的数:")) for i in range(1,n+1): s += i/(i+1) print("前{0}项和为{1}".format(n,s)) s Read More
posted @ 2023-02-09 10:02 秋刀鱼CCC Views(64) Comments(0) Diggs(0) Edit