n = float(input())
a = 2
b = 1
x = 0
sn = 0
while x < n: # a 和 b 作为中间变量传递numerator和denominator的值
numerator = a
denominator = b
#先
第3关:计算数列的前n项之和
最新推荐文章于 2022-12-02 19:32:14 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
n = float(input())
a = 2
b = 1
x = 0
sn = 0
while x < n: # a 和 b 作为中间变量传递numerator和denominator的值
numerator = a
denominator = b
#先