题解 | #牛牛学数列2#
牛牛学数列2
http://www.nowcoder.com/practice/fc72951f52984f3abd286d82eeffacba
和上一题思路一样,遍历累加就行了, 而且还不用做条件判断
a=int(input())
b=0
for x in range(1,a+1):
b+=1/x
print(f"{b:.6f}")
牛牛学数列2
http://www.nowcoder.com/practice/fc72951f52984f3abd286d82eeffacba
和上一题思路一样,遍历累加就行了, 而且还不用做条件判断
a=int(input())
b=0
for x in range(1,a+1):
b+=1/x
print(f"{b:.6f}")
相关推荐