高分求VB中一个数学式的程序

2025-02-23 09:47:30
推荐回答(6个)
回答1:

楼上的眼花了吗? x平方能那样写吗。
if x<-1 then
y=x
elseif x>=-1 and x<0 then
y=x*x
else
y=3*x+1
end if

回答2:

IF X<-1 THEN
Y=X
ELSEIF X<0 AND X>=-1 THEN
Y=X^2
ELSEIF X>0 THEN
Y=3*X+1
END IF

回答3:

q490097855你才眼花呢,X平方本来就可以这样表示

回答4:

Dim x, y As Integer
Private Sub Form_Click()
x = InputBox("")
If x < -1 Then
y = x
ElseIf x >= -1 And x < 0 Then
y = x ^ 2
ElseIf x >= 0 Then
y = 3 * x + 1
End If
Print y
End Sub

回答5:

怎么都没有用case语句呢
function y(x)
select case x
case is<-1
y=x
case -1 to 0
y=x^2
case is >0
y=3*x+1
end select
end function

回答6:

if x < -1 then
Y=X
elseif x < 0 and x>= -1 then
Y=X^2
elseif x>= 0 then
Y=3X+1
end if