你的原代码修改如下:
程序代码:
'定义变量 Dim arr1 as 人员 '数组赋值 '注释掉 arr1 = Array(a(1).年龄, a(2).年龄, a(3).年龄) For m = 0 To UBound(a) For i = m + 1 To UBound(a) arr1 = a(m) If a(m).年龄 > a(i).年龄 Then a(m) = a(i) a(i) = arr1 End If Next MsgBox a(m).年龄 Next
能编个毛线衣吗?