急求vb实验报告一份,不要网上的,哪位大神帮帮忙啊?回答有粉
dnf红眼吧
全部回复
仅看楼主
level 7

利用随机函数产生80个10~99之间的随机整数,将其中的奇数按由小到大的顺序排列并输出;在产生的80个随机整数中,找出其中的素数。
2012年06月14日 03点06分 1
level 9
我都忘了 素数 质数都是啥了 [拍砖]
2012年06月14日 03点06分 2
level 7
我勒个去----
2012年06月14日 03点06分 3
level 6
dim a()
for i=1 to 80 循环80次
x=rnd(90)+10 10-99的数
for j=80 to 2 step -1
for k=1 to j-1
if a(k)>a(k) then t=a(k):a(k)=a(k+1):a(k+1)=t
next k;j;i
for i=1 to 80
print a(i);
next
for i=1 to 80
for j=2 to sqr(a(i))
if a(i) mod j=0 then a=1
next j
if a<>1 then print a(i)
next
2012年06月14日 03点06分 4
level 6
不知道行不行·你自己试试
2012年06月14日 03点06分 5
level 7
不行啊,亲~~~~
2012年06月14日 06点06分 6
level 7
已粉
2012年06月14日 06点06分 7
level 6
e。的确是错的。错了2个
2012年06月14日 17点06分 8
level 6
for j=80 to 2 step -1 上面空一行写next
2012年06月14日 17点06分 9
level 6
这句也改 if a(k)>a(k+1) then t=a(k):a(k)=a(k+1):a(k+1)=tnext k;j;
2012年06月14日 17点06分 10
level 6
循环80次 10-99的数 这是不用写的。电脑读不出来
2012年06月14日 17点06分 11
1