20个元素,每5个打印一行
Private Sub Command1_Click()
Dim a(20) As Integer,s As Integer
For i = 1 To 20
a(i) = Int(Rnd * 1000) + 1
Print a(i);
If i Mod 5 = 0 Then Print
Next i
For i = 1 To 20
If a(i) Mod 2 0 Then
s = s + a(i)
End If
Next i
Print " 奇数和为:" & s
End Su