vb求1000到2000范围内的所有素数的这和
发布网友
发布时间:2024-10-24 19:06
我来回答
共1个回答
热心网友
时间:2024-10-24 19:05
Private Sub Form_Click()
Dim i As Integer, j As Integer, n As Long
For i = 1000 To 2000
For j = 2 To Int(Sqr(i))
If i Mod j = 0 Then Exit For
Next
If j > Int(Sqr(i)) Then n = n + i
Next
Print n
End Sub