编写vb程序 求1000到2000范围内由小到大第100个素数
答案:2 悬赏:0
解决时间 2021-02-16 11:54
- 提问者网友:心裂忍耐
- 2021-02-16 02:55
编写vb程序 求1000到2000范围内由小到大第100个素数
最佳答案
- 二级知识专家网友:飘零作归宿
- 2021-02-16 04:23
Dim n As Integer
n = 0
For i = 1000 To 2000
If IsSushu(i) Then
n = n + 1
If n = 100 Then
MsgBox(i)
End If
End If
Next
n = 0
For i = 1000 To 2000
If IsSushu(i) Then
n = n + 1
If n = 100 Then
MsgBox(i)
End If
End If
Next
全部回答
- 1楼网友:滚刀废物浮浪人
- 2021-02-16 05:50
dim count1 as double
dim kaiguan as boolean
sub delay(byval time as long)
for i=1 to delaytime
doevents
next i
end sub
private sub command1_click()
if command1.caption = "kaishi" then
kaiguan = true
elseif command1.caption = "tingzhi" then
kaiguan = false
end if
if kaiguan = true then
for i = 1 to 100000
count1 = count1 + 1
list1.additem(count1)
label1.caption = count1
if kaiguan = false then
exit for
end if
delay(1000)
next
end if
end sub
private sub form_load()
command1.caption = "kaishi"
timer1.enabled = false
end sub
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯