给你一个求素数的函数
function isprime(n as integer) as boolean isprime=true'赋初值 for i=2 to int(sqr(n)) if n mod i=0 then'如果能除尽 isprime=false'证明是素数 exit for end if next i
end function
dim a() as string
randomize
for i=1 to 10 a(i)=int(100*rnd+1)
next
for i=1 to 10 for j=2 to a(i)-1 if a(i)\j=0 then k=k+1 next if k=0 then print a(i)
next