各位大神帮忙看看,这个vb程序是那里出了问题

2024-12-27 22:06:23
推荐回答(1个)
回答1:

Private Const p = 3.141592653

Private Sub Command1_Click()
Dim a As Single
Dim y As Single
Dim x As Single
x = Val(Text1.Text)

If x > 270 Then

y = 3 * Sin(x * p / 180) + 6 * Cos(5 * x * p / 180)
ElseIf x > 60 And x < 180 Then
y = 2 * Cos(x * p / 180) - 1
Else
y = 0
End If
Text2.Text = y
End Sub