1樓:
dim x as integer, i as integerdim y as integer
for x = 10 to 100
y = int(sqr(x)) + 1
for i = 2 to y
if x mod i = 0 then
exit for
end if
next i
if i = y + 1 then
print x;
end if
next x
2樓:麥兜
option explicit
private sub form_load()dim i as long, j as long, k as long
show
for i = 10 to 100
k = k + 1
for j = 2 to i - 1
if i mod j = 0 then exit fornext
if k = 50 then print: k = 0if j > i - 1 then print j;
next
end sub
vb 編寫編寫程式,輸出由1,2,3,4,5,6這數字組
dim a dim temp as string dim n as integer dim i,j,k,t,y,u as integera split 1,2,3,4,5,6 temp n ubound a dim cou as integer 0if trim a ubound a then n ...
vb編寫可以在指定時間執行程式的程式
一.在核心功能執行前插入一段按時間啟動的 二.在核心功能執行後開始一段倒計關閉的 三.鍵鼠鎖加個鉤子不給控制代碼就可以了 四.熱鍵 有了鉤子你就可能做了 vb中怎樣實現在指定時間執行指定程式 timer只能是相對時間,等多長時間做什麼事情。想按日期的話用api來做吧 其實可以用計劃任務,比你用vb做...
用VB編寫「求100以內3的倍數」的程式
for i 3 to 100 if i mod 3 0 then print i 除以3餘數為0的話,就是3的倍數。next 望。private sub command1 click for i 1 to 100 if i mod 3 0 then i nextexit sub end sub效果 ...