private sub command1_click() dim a(5) as integer dim I as integer dim j as integer dim k as integer randomize for I = 1 to 5 a(I)=int(rnd()*90+10) next cls prin "排序前:" for i=1 to 5 print a(i);space(2); next print:print "排序后:" for i=1 to 4 for j=i+1 to 5 if a(I)>a(j) then k=a(I) a(I)=a(j) a(j)=k end if next j next I for i=1 to 5 print a(I);space(2); next end sub 有什么问题请留言。追问