有10個不同的漢字,怎么使2個漢字組成一組,比如:(一二,一三,天地....)輸出所有漢字組成的所有結果。輸出到文本檔案,一行一組漢字的組合。 注:10個所有的組合是x的平方,也就是 10*10=100組

哪位大哥知道怎么做啊?
uj5u.com熱心網友回復:
補充一點:這10個漢字從文本檔案匯入uj5u.com熱心網友回復:
兩個for回圈不就行了?uj5u.com熱心網友回復:
Dim i As Integer, j As Integer
Dim strSource As String
strSource = "一二三四五六上下天地"
Open "c:\test1.txt" For Output As #1
For i = 1 To 9
Print #1, Mid(strSource, i, 1) & Mid(strSource, i, 1)
For j = i + 1 To 10
Print #1, Mid(strSource, i, 1) & Mid(strSource, j, 1)
Print #1, Mid(strSource, j, 1) & Mid(strSource, i, 1)
Next j
Next i
Print #1, Mid(strSource, 10, 1) & Mid(strSource, 10, 1)
Close #1
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/95257.html
標籤:VB基礎類
