python题
【问题描述】
其中输入的n值为整数(n>=1)
【输入形式】1 10 (中间空一格)
【输出形式】s=2.718282
x,n = map(float,input().split())
s = 1+x
i = 1
a = 1
while i<=n:
a = a*x/(i+1)
s = a + s
i+=1
print('s=%.6f'%s)
【问题描述】
其中输入的n值为整数(n>=1)
【输入形式】1 10 (中间空一格)
【输出形式】s=2.718282
x,n = map(float,input().split())
s = 1+x
i = 1
a = 1
while i<=n:
a = a*x/(i+1)
s = a + s
i+=1
print('s=%.6f'%s)