VB做 键盘输入一个数(任意实数),利用分段函数计算y=x2+3(x>0),y=-5x+x2(x
问题描述:
VB做 键盘输入一个数(任意实数),利用分段函数计算y=x2+3(x>0),y=-5x+x2(x
答
Private Sub Command1_Click()i = Val(InputBox("input a number"))If i 0 Theny = x * 2 3Elsey = -5 * x x * 2End IfPrint yEnd SubPrivate Sub Form_Load()Dim x,y As Doublex = InputBox("请输入实数","输入")If...