> 其他 >
VB 编写程序,求函数y的值(当x小于等于0时,y=3x+1;当x>0时,y=4x+1)
人气:470 ℃ 时间:2020-04-27 00:41:31
解答
Dim ax,y As Integer
Private Sub Command1_Click()
x = Text1.Text
If x > 0 Then
y = 4 * x + 1
Else:y = 3 * x + 1
End If
Text2.Text = y
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版