求解这道VB题怎么做
VB的,如图产生50个100-500间的整数,找出其中的素数并打印在窗体上,每行五个,请在适当位置填空。PrivateSubCommand1_Click()Dimi%,x...
VB的,如图
产生50个100-500间的整数,找出其中的素数并打印在窗体上,每行五个,请在适当位置填空。
Private Sub Command1_Click()
Dim i%, x%, j%, f%,t%
Randomize
For i = 1 To 50
x =(1)
f = 0
For j = (2)
If (3) Then (4) : Exit For
Next j
If f = 0 Then
(5)
Print x;
If t mod 5=0 Then (6)
End If
Next i
End Sub 展开
产生50个100-500间的整数,找出其中的素数并打印在窗体上,每行五个,请在适当位置填空。
Private Sub Command1_Click()
Dim i%, x%, j%, f%,t%
Randomize
For i = 1 To 50
x =(1)
f = 0
For j = (2)
If (3) Then (4) : Exit For
Next j
If f = 0 Then
(5)
Print x;
If t mod 5=0 Then (6)
End If
Next i
End Sub 展开
展开全部
Private Sub Command1_Click()
Dim i%, x%, j%, f%, t%
Randomize
For i = 1 To 50
x = 100 + Int(Rnd * 401)
f = 0
For j = 2 To x - 1
If x Mod j = 0 Then f = 1: Exit For
Next j
If f = 0 Then
t = t + 1
Print x;
If t Mod 5 = 0 Then t = 0: Print
End If
Next i
End Sub
Dim i%, x%, j%, f%, t%
Randomize
For i = 1 To 50
x = 100 + Int(Rnd * 401)
f = 0
For j = 2 To x - 1
If x Mod j = 0 Then f = 1: Exit For
Next j
If f = 0 Then
t = t + 1
Print x;
If t Mod 5 = 0 Then t = 0: Print
End If
Next i
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询