Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Math
- Public Class Form1
- Function mvod(ByVal T As TextBox)
- Return Val(T.Text)
- End Function
- Overloads Sub mvivod(ByVal r As Double, ByVal T As TextBox)
- T.Text = CStr(r)
- End Sub
- Overloads Sub mvivod(ByVal n As Integer, ByVal T As TextBox)
- T.Text = CStr(n)
- End Sub
- Sub cool(ByVal x As Double, ByVal y As Double, ByVal z As Double, ByVal c As Double, ByRef r As Double, ByRef n As Integer)
- Dim cy, kx, tx, z3 As Double
- cy = c * y
- kx = x ^ (1 / 2)
- tx = Tan(x)
- z3 = z ^ 3
- If cy > kx Then
- r = cy
- Else
- r = kx
- End If
- If y * z > 0 And x > 0 Then
- If (r > y) Then
- r = y
- End If
- If (r > z) Then
- r = z
- End If
- n = 1
- Else
- If y * z < 0 And x > 0 Then
- If (tx > z3) Then
- r = z3
- Else
- r = tx
- End If
- n = 2
- Else
- n = 3
- r = 15
- End If
- End If
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim x, y, z, c, r As Double, n As Integer
- x = mvod(TextBox1)
- y = mvod(TextBox2)
- z = mvod(TextBox3)
- c = mvod(TextBox4)
- cool(x, y, z, c, r, n)
- mvivod(r, TextBox5)
- mvivod(n, TextBox6)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement