VB程序设计:求100-200间能被3整除、不能被7整除的数的和。
2013-01-03
展开全部
Private Sub Command1_Click()
Dim s As Integer
For i = 100 To 200
If i Mod 3 = 0 And i Mod 7 <> 0 Then s = s + i
Next i
Print "所求的和为:" & s
End Sub
Dim s As Integer
For i = 100 To 200
If i Mod 3 = 0 And i Mod 7 <> 0 Then s = s + i
Next i
Print "所求的和为:" & s
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询