
展开全部
dim x as single
dim y as single
x = inputbox("输入x的值:")
if x<0 then
y= -2*x+1
elseif x=0
y=0
else
y = 2*x+1
end if
print y
dim y as single
x = inputbox("输入x的值:")
if x<0 then
y= -2*x+1
elseif x=0
y=0
else
y = 2*x+1
end if
print y
更多追问追答
追问
请问不需要在y=2x+1前写x>0么?
追答
加不加都可以,因为到这里,只剩下这一种情况了???
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询