用for循环100-200 在循环中用if判断数字能否被三整除,如果能就输出,并放入累加器中 网吧没装vb,写代码比较麻烦。。。(这个代码很容易写)
Private Sub Form_Click()
Dim i As Integer, sum As Integer
sum = 0
For i = 100 To 200
If ((i Mod 2) = 1) And ((i Mod 3) <> 0) Then
Print i
sum = sum + i
End If
Next i
Print sum
End Sub