vb程序问题
PrivateSubForm_Click()DimiAsIntegerDimjAsIntegerFori=2To100Forj=2Toi-1IfiModj=0ThenEx...
Private Sub Form_Click()
Dim i As Integer
Dim j As Integer
For i = 2 To 100
For j = 2 To i - 1
If i Mod j = 0 Then
Exit For
End If
Next j
If j = i Then Print i
Next i
End Sub
为什么j最大取i-1,但是输出时j=i? 展开
Dim i As Integer
Dim j As Integer
For i = 2 To 100
For j = 2 To i - 1
If i Mod j = 0 Then
Exit For
End If
Next j
If j = i Then Print i
Next i
End Sub
为什么j最大取i-1,但是输出时j=i? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询