第1个回答 2014-07-18
那预先把题号放在数组中,随机抽取一项后把该号从数组中去掉。
还是用集合较好,
声明区定义集合变量
dim cols as collection
先初始集合:
private sub initCols
set cols=new collection
dim i as integer
for i=1 to 55
cols.add i
next
end sub
产生题号:
dim index as integer
index=int(rnd*cols.Count+1) '这是产生一个随机索引
a=cols.item(index) '通过索引获取题号
cols.remove index '然后把该项去掉本回答被网友采纳