VB6.0 从4个字符串数组中分别选择一个 排列出所有组合 并保存到TXT
现有4个一维字符串数组,a(4)、b(4)、c(4)、d(4)。从每个中选一个元素然后排列出所有组合。例如,a1b1c1d0a1b1c1d1a1b1c1d2..a4b4c...
现有4个一维字符串数组,a(4)、b(4)、c(4)、d(4)。从每个中选一个元素然后排列出所有组合。例如,
a1 b1 c1 d0
a1 b1 c1 d1
a1 b1 c1 d2
.
.
a4 b4 c4 d4
一共5*5*5*5=625行数据
请各位高手指点 ~~ 谢谢啊
4个一维数组分别放在4个TEXT中 每个text中分行显示数组的元素 点击COMMAND1 直接将结果保存到TXT 展开
a1 b1 c1 d0
a1 b1 c1 d1
a1 b1 c1 d2
.
.
a4 b4 c4 d4
一共5*5*5*5=625行数据
请各位高手指点 ~~ 谢谢啊
4个一维数组分别放在4个TEXT中 每个text中分行显示数组的元素 点击COMMAND1 直接将结果保存到TXT 展开
展开全部
Dim a$(4), b$(4), c$(4), d$(4)
Private Sub command1_click()
Open "d:/001.txt" For Output As #1
For i = 0 To 4
For j = 0 To 4
For k = 0 To 4
For l = 0 To 4
Print #1, a(i) & b(i) & c(i) & d(i) & " ";
Next l, k, j, i
Close #1
End Sub
Private Sub Form_Load()
Show
Text1 = "": Text2 = "": Text3 = "": Text4 = ""
For i = 0 To 4
a(i) = Chr(65 + i): Text1 = Text1 + a(i)
b(i) = Chr(70 + i): Text2 = Text2 + b(i)
c(i) = Chr(75 + i): Text3 = Text3 + c(i)
d(i) = Chr(85 + i): Text4 = Text4 + d(i)
Next
End Sub
追问
为什么运行出来结果只有 AFKU BGLV CHMW DINX EJOY 5种数据 每种125个? 没有AFKV AFKW.........等数据啊 625个组合是不相同的 。
2015-07-26
展开全部
'窗体中需两个Text、两个Label、一个Command
Option Explicit
Private mlngAllNumCount As Long, mlngGetNumCount As Long
Private mblnCancelProc As Boolean, mlngCurResultCount As Long
Private mastrOneResult() As String
Private mlngFileNo As Long, mstrResultFile As String
Dim nums(9) As Integer
Private Sub Form_Load()
nums(0) = 2
nums(1) = 7
nums(2) = 10
nums(3) = 13
nums(4) = 14
nums(5) = 17
nums(6) = 19
nums(7) = 20
nums(8) = 29
nums(9) = 30
Option Explicit
Private mlngAllNumCount As Long, mlngGetNumCount As Long
Private mblnCancelProc As Boolean, mlngCurResultCount As Long
Private mastrOneResult() As String
Private mlngFileNo As Long, mstrResultFile As String
Dim nums(9) As Integer
Private Sub Form_Load()
nums(0) = 2
nums(1) = 7
nums(2) = 10
nums(3) = 13
nums(4) = 14
nums(5) = 17
nums(6) = 19
nums(7) = 20
nums(8) = 29
nums(9) = 30
追问
你这个只创建了一个数组吧~~ 没解决啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询