n = input("请输入一个值:")
a = -1
b = 1
count = 1
if n ==1:
print("前N项和为1")
else :
for i in range[1:n]:
a**2
b = (i+1)/(2*i+1)
sum = sum+(a*b)
break
count = count + sum
print("前%d项和为%0.3f",(n,count))
n = input("请输入一个值:")
a = -1
b = 1
count = 1
if n ==1:
print("前N项和为1")
else :
for i in range[1:n]:
a**2
b = (i+1)/(2*i+1)
sum = sum+(a*b)
break
count = count + sum
print("前%d项和为%0.3f",(n,count))