数学
VB 找出1000以内所有质数的算法

2020-04-29

VB 找出1000以内所有质数的算法
优质解答
Private Sub Command1_Click()
For i = 2 To 1000
For j = 2 To i
If i Mod j = 0 Then Exit For
Next j
If j = i Then Print i;
Next i
End Sub
Private Sub Command1_Click()
For i = 2 To 1000
For j = 2 To i
If i Mod j = 0 Then Exit For
Next j
If j = i Then Print i;
Next i
End Sub
相关问答