Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ruutv6rrand()
- Dim a, b, c, dis, x1, x2 As Single
- a = Cells(2, 2)
- b = Cells(3, 2)
- c = Cells(4, 2)
- dis = (b ^ 2) - (4 * a * c)
- If dis > 0 Then
- x1 = (-b + Sqr(dis)) / (2 * a)
- x2 = (-b - Sqr(dis)) / (2 * a)
- Cells(5, 2) = Round(x1, 2)
- Cells(6, 2) = Round(x2, 2)
- ElseIf dis = 0 Then
- x1 = (-b) / 2 * a
- Cells(5, 2) = x1
- Cells(6, 2) = x1
- Else
- Cells(5, 2) = "Lahend puudub !"
- Cells(6, 2) = "Lahend puudub!"
- End If
- End Sub
Add Comment
Please, Sign In to add comment