【加试题】已知数组a(1)到a(6)的原始数据为”118”,”36”,”98”,”15”,”88”,”2”,对该数组进行排序操作,某同学编写了以下VB程序:
For i=1 to 3
For j=6 to i+1 step -1
If a(j)<a(j-1) then
t=a(j): a(j)=a(j-1): a(j-1)=t
End if
Next j
Next i
则程序运行之后,数组a(1)到a(6)的值依次为( )
- A、”118”,”15”,”2”,”36”,”88”,”98”
- B、”118”,”15”,”36”,”88”,”98”,”2”
- C、”2”,”15”,”36”,”118”,”88”,”98”
- D、”2”,”15”,”36”,”88”,”98”,”118”