[求助]vb编程
用随机函数产生100个三位数的整数,并按从大到小的顺序输出,每行输出10个数.这个题目用vb怎么编。请大家帮忙。
option base 1
dim a(100) as integer
private sub form_clic()
dim i as integer, j as integer ,k as integer,t as integer
for i=1 to 100
a(i)=int(900*rnd)+100
next i
for j=1 to 99
for k=1 to 99-i
if a(k)<a(k+1) then
t=a(k)
a(k)=a(k+1)
a(k+1)=a(k)
endif
next k,j
for i=1 to 100
if i mod 10 =0 then
print a(i)
else
print a(i); ' look the ; behand a(i)
end if
next i
end sub
[此贴子已经被作者于2007-4-8 19:29:06编辑过]