當前位置:編程學習大全網 - 編程軟體 - vb 多個數組排列組合

vb 多個數組排列組合

Private?Sub?Command1_Click()

List1.Clear

Dim?t1(),?t2(),?t3(),?t()

t1?=?Array(1,?2,?3,?4)

t2?=?Array(5,?7,?8,?10)

t3?=?Array(9,?11,?12,?18,?22,?24,?25)

t?=?Array(t1,?t2,?t3)

For?i?=?LBound(t)?To?UBound(t)

Label1(i)?=?"t"?+?CStr(i?+?1)?+?"?=("

For?j?=?LBound(t(i))?To?UBound(t(i))

If?j?<?UBound(t(i))?Then

Label1(i)?=?Label1(i)?+?CStr(t(i)(j))?+?","

Else

Label1(i)?=?Label1(i)?+?CStr(t(i)(j))?+?")"

End?If

Next?j

Next?i

For?i?=?LBound(t(0))?To?UBound(t(0))

For?j?=?LBound(t(1))?To?UBound(t(1))

For?k?=?LBound(t(2))?To?UBound(t(2))

List1.AddItem?CStr(t(0)(i))?+?Space(1)?+?CStr(t(1)(j))?+?Space(1)?+?CStr(t(2)(k))

Next?k

Next?j

Next?i

Label2.Caption?=?"***計"?+?CStr((UBound(t(0))?+?1)?*?(UBound(t(1))?+?1)?*?(UBound(t(2))?+?1))?+?"種"

End?Sub

  • 上一篇:華晨寶馬改名叫什麽?
  • 下一篇:讀取文件的編程
  • copyright 2024編程學習大全網