有下列代码,通过前n项的计算,求Pi近似值,下列选项中正确的是 ( )
s=0;n=0;i=0
n=int(input("请输入n的值"))
for i inrange(2,2*n+1, ① ):
s=s+ ②
print (s)
pi = 3 + s * 4
print(pi)
② (-1)**(i//2+1)/(i*(i+1)*(i+2))
B . ①2② (-1)**(i//2+1)/(i*(i+1)*(i+2))
C . ①1② (-1)**(i//2)/(i*(i+1)*(i+2))
D . ①2② (-1)**(i//2)/(i*(i+1)*(i+2))