SHARE
TWEET

Untitled

a guest Oct 21st, 2018 168 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Math
  2. Public Class Form1
  3.  
  4.     Function mvod(ByVal T As TextBox)
  5.         Return Val(T.Text)
  6.     End Function
  7.  
  8.     Overloads Sub mvivod(ByVal r As Double, ByVal T As TextBox)
  9.         T.Text = CStr(r)
  10.     End Sub
  11.  
  12.     Overloads Sub mvivod(ByVal n As Integer, ByVal T As TextBox)
  13.         T.Text = CStr(n)
  14.     End Sub
  15.  
  16.  
  17.     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)
  18.         Dim cy, kx, tx, z3 As Double
  19.         cy = c * y
  20.         kx = x ^ (1 / 2)
  21.         tx = Tan(x)
  22.         z3 = z ^ 3
  23.         If cy > kx Then
  24.             r = cy
  25.         Else
  26.             r = kx
  27.         End If
  28.         If y * z > 0 And x > 0 Then
  29.  
  30.             If (r > y) Then
  31.                 r = y
  32.             End If
  33.  
  34.             If (r > z) Then
  35.                 r = z
  36.             End If
  37.             n = 1
  38.  
  39.         Else
  40.             If y * z < 0 And x > 0 Then
  41.                 If (tx > z3) Then
  42.                     r = z3
  43.                 Else
  44.                     r = tx
  45.                 End If
  46.                 n = 2
  47.             Else
  48.                 n = 3
  49.                 r = 15
  50.             End If
  51.         End If
  52.     End Sub
  53.  
  54.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  55.         Dim x, y, z, c, r As Double, n As Integer
  56.         x = mvod(TextBox1)
  57.         y = mvod(TextBox2)
  58.         z = mvod(TextBox3)
  59.         c = mvod(TextBox4)
  60.         cool(x, y, z, c, r, n)
  61.         mvivod(r, TextBox5)
  62.         mvivod(n, TextBox6)
  63.  
  64.     End Sub
  65. End Class
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top