Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public a As Integer
- Public n As Integer
- Public Sub Start()
- a = InputBox("Введите переменную а", "Пиши давай")
- n = InputBox("Введите переменную n", "Пиши давай")
- Call Num_Check(a, n)
- End Sub
- Public Sub Num_Check(a, n)
- If IsNumeric(a) And IsNumeric(b) Then
- Call Math_Check(a, n)
- Else
- MsgBox "Вы ввели не числовое значение!", vbCritical, "Ошибка!"
- End If
- End Sub
- Public Sub Math_Check(a, n)
- Dim Level1 As Boolean, Level2 As Boolean
- Level1 = False
- Level2 = False
- If a = 0 Then
- MsgBox "Введённое вами значение переменной а равно нулю, а на ноль делить нельзя!", vbCritical, "Ошибка!"
- Else
- Level1 = True
- End If
- If n < 0 Then
- MsgBox "Введённое вами значение переменной n меньше нуля!", vbCritical, "Ошибка!"
- Else
- Level2 = True
- End If
- If Level1 = True And Level2 = True Then
- Call Work(a, n)
- End If
- End Sub
- Function my_root(x, n)
- If x < 0 Then
- my_root = Abs(x) ^ n * -1
- Else:
- my_root = Abs(x) ^ n
- End If
- End Function
- Public Sub Work(a, n)
- x = -5
- i = -5
- Do
- Drob = (my_root(x, 2.5)) / (Abs(3 * a))
- If Drob > 0 Then
- Logf = Log(Drob)
- Else:
- Logf = 0
- End If
- y = 0.81 * Logf
- If Logf <> 0 Then
- Do
- abssin = 0.11 * Abs(Sin((2 * i) + 1)) + y
- firstbrack = 6 - my_root(abssin, (3 / 4))
- secondbrack = 3 * Sin(a * x - 1)
- S = firstbrack + secondbrack
- ' MsgBox x & " " & y & " " & i & " " & abssin & " " & firstbrack & " " & secondbrack & " " & S
- Sum = Sum + S
- i = i + 1
- Loop Until i <> n - 5 + 1
- End If
- x = x + 0.5
- Loop Until x = 5.5
- MsgBox Sum
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement