Dim k As String
n = 9
TextBox1.Text = ""
For i = 0 To n
k = InputBox("Ввести " + CStr(i + 1) + " элемент")
A(i) = Val(k)
TextBox1.Text = TextBox1.Text + " " + CStr(A(i)) + vbCrLf
Next i
End Sub
Private Sub CommandButton2_Click()
Dim max, p, r, s As Integer
Dim sred As Single
If CheckBox1.Value = True Then
max = 0
For i = 1 To n
If A(i) > A(max) Then max = i
Next i
TextBox2.Text = CStr(A(max))
End If
If CheckBox2.Value = True Then
p = 0
For i = 0 To n
If A(i) Mod 2 <> 0 Then p = p + 1
Next i
TextBox3.Text = CStr(p)
End If
If CheckBox3.Value = True Then
s = 0
r = 0
For i = 0 To n
If A(i) < 0 Then
s = s + A(i)
r = r + 1
End If
Next i
If r = 0 Then
MsgBox ("Нет отрицательных элементов")
CommandButton1.SetFocus
Else
sred = s / r
TextBox4.Text = CStr(sred)
End If
End If
End Sub
Private Sub CommandButton3_Click()
End
End Sub