Нужно вывести ответ в массиве
VB.NET / VBA:
Sub Task2()
'
Dim a As Single
Dim p As Single
Dim y As Single
Dim x As Single
Dim x0 As Single
Dim xn As Single
Dim dx As Single
a = InputBox("Ввести a")
p = InputBox("Ввести p")
x0 = InputBox("Ввести x0")
xn = InputBox("Ввести xn")
dx = InputBox("Ввести dx")
x = x0
While x <= xn
If x = 1.4 Then
y = a * x ^ 3 + 7 * Sqr(x)
MsgBox ("При x= " + Str(x) + " значение y= " + Str(y))
Else
If x < 1.4 Then
y = p * x ^ 2 - 7 / x ^ 2
MsgBox ("При x= " + Str(x) + " значение y= " + Str(y))
Else
y = Log(x + 7 * Sqr(Abs(x + a)) / Log(10))
MsgBox ("При x= " + Str(x) + " значение y= " + Str(y))
End If
End If
x = x + dx
Wend
End Sub
Последнее редактирование: