题解 | #牛牛学数列3#
牛牛学数列3
https://www.nowcoder.com/practice/f65c726d081c4160a9356eabf0dc21d9
n = int(input())
sum = 0
b = 0
for i in range(1,n+1):
b = (-1)**(i+1)*(2*i-1)
sum += 1/b
print("{:.3f}".format(sum))
sum = 0
b = 0
for i in range(1,n+1):
b = (-1)**(i+1)*(2*i-1)
sum += 1/b
print("{:.3f}".format(sum))
###大佬们帮我看看哪里不对了