Dim a, b, c
Dim x1, x2
Private Sub Command1_Click()
Cls
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
If b * b < 4 * a * c Then
Print "ERROR"
Else
x1 = (-b + Sqr(b * b - 4 * a * c)) / (2 * a)
x2 = (-b - Sqr(b * b - 4 * a * c)) / (2 * a)
x1 = Format(x1, "0.0000")
x2 = Format(x2, "0.0000")
Print x1, x2
End If
End Sub
望采纳。。。。