|
|
发表于 2006-7-15 05:51:00
|
显示全部楼层
Re:编程点将台第27期
vb.net:
dim resault as arraylist
dim i as integer
dim tmp as integer
'计算
for i=1 to 15
tmp+=9
if tmp>30 then
tmp=30-tmp
end if
resault.add tmp
next i
'排序
dim red as string,white as string
for i=1 to 30
if resault.indexof(i)=-1 then
white+=i & " "
else
red+=i & " "
next i
console.writeline "red:" & red
console.writeline "white:" & white
一共45次循环,比楼主少不少次,呵呵 |
|