输入一个整数n,n>0,计算s=1+1/2+1/3+…1/n的和,是一道python的题
收起
n = eval(input()) sum = 0 for i in range(1,n+1): sum = sum + (1 / i) print(sum)
报告相同问题?