Private Sub Command1_Click() Dim i As Integer,n As Integer,nRand As Integer Dim sum1 As Integer,sum2 As Integer,sum3 As Integer
n = 0 sum1 = 0 sum2 = 0 sum3 = 0
Randomize
For i = 1 To 50 nRand = CInt(90 * Rnd + 10)
n = n + 1 If n > 10 Then n = 1 Print End If Print nRand;
If nRand Mod 3 = 0 Then sum1 = sum1 + nRand End If If nRand Mod 5 = 0 Then sum2 = sum2 + nRand End If If nRand Mod 3 = 0 And nRand Mod 5 = 0 Then sum3 = sum3 + nRand End If Next
Print Print Print "sum1:",sum1 Print "sum2:",sum2 Print "sum3:",sum3 End Su