一道vb题目Private Sub Command1_Click() x = -5 If Sgn(x + 5) Then y = Sgn(x + 2) * Sgn(x - 2) Else y = Sgn(x) End If Print yEnd Sub为什么算到 Sgn(x + 5)时就跳到 y = Sgn(x)算了呢?怎么算的啊?急用啊
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/15 21:24:22
一道vb题目PrivateSubCommand1_Click()x=-5IfSgn(x+5)Theny=Sgn(x+2)*Sgn(x-2)Elsey=Sgn(x)EndIfPrintyEndSub为什
一道vb题目Private Sub Command1_Click() x = -5 If Sgn(x + 5) Then y = Sgn(x + 2) * Sgn(x - 2) Else y = Sgn(x) End If Print yEnd Sub为什么算到 Sgn(x + 5)时就跳到 y = Sgn(x)算了呢?怎么算的啊?急用啊
一道vb题目
Private Sub Command1_Click()
x = -5
If Sgn(x + 5) Then
y = Sgn(x + 2) * Sgn(x - 2)
Else
y = Sgn(x)
End If
Print y
End Sub
为什么算到 Sgn(x + 5)时就跳到 y = Sgn(x)算了呢?怎么算的啊?
急用啊
一道vb题目Private Sub Command1_Click() x = -5 If Sgn(x + 5) Then y = Sgn(x + 2) * Sgn(x - 2) Else y = Sgn(x) End If Print yEnd Sub为什么算到 Sgn(x + 5)时就跳到 y = Sgn(x)算了呢?怎么算的啊?急用啊
sgn函数
x>0,sgnx=1
x=0,sgnx= 0
x