Sub z() Dim a(10) As Integer p = 1 s = "Последовательность:" For i = 1 To 10 a(i) = Int(Rnd * 50) s = s & " " & a(i) If a(i) > 7 And a(i) < 20 Then p = p * a(i) n = n + 1 End If Next i s = s & Chr(13) & "Количество элементов: " & n & Chr(13) & "Их произведение: " & p MsgBox (s) End Sub
Dim a(10) As Integer
p = 1
s = "Последовательность:"
For i = 1 To 10
a(i) = Int(Rnd * 50)
s = s & " " & a(i)
If a(i) > 7 And a(i) < 20 Then
p = p * a(i)
n = n + 1
End If
Next i
s = s & Chr(13) & "Количество элементов: " & n & Chr(13) & "Их произведение: " & p
MsgBox (s)
End Sub