#Region "定义一个PX函数并对二维数组进行排序,然后返回该数组"
For j As Integer = 0 To 14 - i Step 1
If a(j, 1) > a(j + 1, 1) Then
Dim temp1 As Integer = a(j, 1)
Dim temp2 As Integer = a(j, 0)
a(j, 1) = a(j + 1, 1)
a(j + 1, 1) = temp1
a(j, 0) = a(j + 1, 0)
a(j + 1, 0) = temp2
End If
Next
Next
Return a
End Function
#End Region
rem 本函数只说明传过来的数组为a(n,1) 的数组,具体可以参考此函数进行编程
Private Function px(ByVal a(,) As Integer) As Integer(,)
For i As Integer = 0 To 14 Step 1For j As Integer = 0 To 14 - i Step 1
If a(j, 1) > a(j + 1, 1) Then
Dim temp1 As Integer = a(j, 1)
Dim temp2 As Integer = a(j, 0)
a(j, 1) = a(j + 1, 1)
a(j + 1, 1) = temp1
a(j, 0) = a(j + 1, 0)
a(j + 1, 0) = temp2
End If
Next
Next
Return a
End Function
#End Region