Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton1_Click()
- Dim a, b, c, d As Integer
- Dim x1, x2 As Double
- a = InputBox1("Ââåäèòå ïàðàìåòð a")
- b = InputBox2("Ââåäèòå ïàðàìåòð b")
- c = InputBox3("Ââåäèòå ïàðàìåòð c")
- d = (b ^ 2) - 4 * a * c
- TextBox4 = "d=" & d
- Select Case d
- Case Is < 0
- TextBox4 = " ÍÅÒ ÐÅØÅÍÈß"
- Case Is = 0
- x1 = (-b) / (2 * a)
- x2 = (-b) / (2 * a)
- TextBox5 = "x1=" & x1 & "x2=" & x2
- Case Is > 0
- x1 = (-b + Sqr(d)) / (2 * a)
- x2 = (-b - Sqr(d)) / (2 * a)
- TextBox5 = "x1=" & x1 & "x2=" & x2
- End Select
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement