vb程序设计, 找出100到500以内所有能同时被3、5、7整除的正整数,并用变量N记录有多少个数。

要程序代码,谢谢·
2024-12-14 02:52:51
推荐回答(1个)
回答1:

Private Sub Form_Click()
Dim i As Integer, N As Integer
For i = 100 To 500
If i Mod 3 = 0 And i Mod 5 = 0 And i Mod 7 = 0 Then
Print i; " ";
N = N + 1
End If
Next i
Print
Print "共有" & N & "个"
End Sub