钢铁雄心3如何宣战:问个VB的问题!!请高手帮忙!

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 01:11:43
任意从键盘输入10个整数,将它们按升序排出.

采用“比较交换法”
dim a(1 to 10) as integer
dim i as integer ,j as integer, temp as integer
for i=1 to 10
a(i)=val(inputbox("enter a number"))
next i
for i=1 to 9
for j=i+1 to 10
if a(i)<a(j) then
temp=a(i):a(i)=a(j):a(j)=temp
end if
next j
next i
for i= 1 to 10
debug.print a(i);"";
next i