Dim a(1 To 15) As Integer, num As Integer, s As String
'生成数组a,a(1)=73,a(2)=58, a(3)=62, a(4)=36…代码略
Private Sub Command1_Click()’对数组进行排序
num = 5: k = 1: f = 1
For i = 1 To num
k = k + i
For m = k - i To ①
For n = k - i To 2 * k - 2 - i - m
If ② Then t = a(n): a(n) = a(n + 1): a(n + 1) = t
Next n
Next m
f = f * (-1)
Next i
'将处理后的数组,以金字塔形显示,代码略
End Sub