题型:综合题 题类:常考题 难易度:困难
浙江省杭州市建人高复2021届高三上学期信息技术第一次考试试卷
图a |
Const n=6
Dina(1 To n*n)As Integer
Private Sub Form_Load() ' 产生n*n个数组元素,每行按n个数显示在list1中
Din i As Integer, s As String
For i=2 To n* n
a(i)=Int(Rnd*90)+10
s =s+ Str(a(i))
If i Mod n = 0 Then List1.AddItem s: s =“”
Next i
End Sub
Private Sub Comnand1_ Click()
Dim i As Integer, j As Integer, k As Integer
For i = 1 To n*n
k= i
For j= To i+n step -n
If a(k) > a(j) Then k= j
Next j
If Then t= a(k): a(k) = a(i): a(i) =t
Next i
‘将排序后数组a的元素,每行按n个数显示在list2中.
End Sub
试题篮