Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.58 KB | None | 0 0
  1. Private Sub CommandButton1_Click()
  2. Dim a, b, c, d  As Integer
  3. Dim x1, x2 As Double
  4. a = val(InputBox1("Введите параметр a"))
  5. b = val(InputBox2("Введите параметр b"))
  6. c = val(InputBox3("Введите параметр c"))
  7. d = (b ^ 2) - (4 * a * c)
  8.  MsgBox("d=" & d)
  9.  Select Case d
  10.  Case Is < 0
  11.   MsgBox("НЕТ РЕШЕНИЯ")
  12.   Case 0
  13.   x1 = (-b) / (2 * a)
  14.   x2 = (-b) / (2 * a)
  15.  TextBox5 = "x1=" & x1 & "x2=" & x2
  16.  Case Is > 0
  17.  x1 = (-b + Sqr(d)) / (2 * a)
  18.   x2 = (-b - Sqr(d)) / (2 * a)
  19.  MsgBox("x1=" & x1 & "x2=" & x2)
  20.  End Select
  21.  
  22. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement