A. vb实验指导书实验5-5怎么做
Private Sub Command1_Click()
Dim delt!, a#, b#, c#
a = InputBox("输入系数a", , 1)
b = InputBox("输入系数b", , 3)
c = InputBox("输入系数c", , 2)
Label2.Caption = "a=" & a & ",b=" & ",c=" & c
delt = b * b - 4 * a * c
If delt >= 0 Then
delt = Sqr(delt)
Label1.Caption = "X1=" & (-b + delt) / 2 / a & vbCrLf & "X2=" & (-b - delt) / 2 / a
Else
Label1.Caption = "无实根"
End If
End Sub