import math
x = float(input(">>>"))
if x >= 3:
y = math.e ** x + x ** 0.5
elif x == 0:
y = math.sin(x) + math.log2(1 + x)
else:
y = -1
y = f"{y:.2f}"
print(y)
你题目的解答代码如下:
import math
x = float(input())
if x>=3:
y = math.exp(x)+x**(1/2)
elif x==0:
y = math.sin(x)+math.log2(1+x)
elif x<0:
y = -1
else:
y = 0
print(f'{y:.2f}')
如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!