Dim c1 Private Sub Form_Load() Me.Hide Open App.Path & "\out2.txt" For Output As #2 Open App.Path & "\in2.txt" For Input As #1
Input #1, n Call c("", n) Print #2, c1 Close #1 Close #2 End End Sub Sub c(a1, b1) If Len(a1) = Len(b1) Then Print #2, a1 c1 = c1 + 1 Else For i = 1 To Len(b1) If InStr(a1, Mid(b1, i, 1)) = 0 Then Call c(a1 & Mid(b1, i, 1), b1) Next i End If End Sub
Dim c As Integer Private Sub Form_Load() Me.Hide Dim N As String Open App.Path & "\in2.txt" For Input As #1 Open App.Path & "\out2.txt" For Output As #2 Input #1, N
If Len(N) < 1 Or Len(N) > 10 Then Else Call R("", N) For i = 0 To List1.ListCount - 1 Print #2, List1.List(i) Next i Print #2, c End If
Close #2 Close #1 End End Sub
Sub R(a, b)
If Len(a) = Len(b) Then List1.AddItem a c = c + 1 Else For i = 1 To Len(b) If InStr(a, Mid(b, i, 1)) = 0 Then Call R(a & Mid(b, i, 1), b) Next End If
Dim c1
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\out2.txt" For Output As #2
Open App.Path & "\in2.txt" For Input As #1
Input #1, n
Call c("", n)
Print #2, c1
Close #1
Close #2
End
End Sub
Sub c(a1, b1)
If Len(a1) = Len(b1) Then
Print #2, a1
c1 = c1 + 1
Else
For i = 1 To Len(b1)
If InStr(a1, Mid(b1, i, 1)) = 0 Then Call c(a1 & Mid(b1, i, 1), b1)
Next i
End If
End Sub
Dim c As Integer
回覆刪除Private Sub Form_Load()
Me.Hide
Dim N As String
Open App.Path & "\in2.txt" For Input As #1
Open App.Path & "\out2.txt" For Output As #2
Input #1, N
If Len(N) < 1 Or Len(N) > 10 Then
Else
Call R("", N)
For i = 0 To List1.ListCount - 1
Print #2, List1.List(i)
Next i
Print #2, c
End If
Close #2
Close #1
End
End Sub
Sub R(a, b)
If Len(a) = Len(b) Then
List1.AddItem a
c = c + 1
Else
For i = 1 To Len(b)
If InStr(a, Mid(b, i, 1)) = 0 Then Call R(a & Mid(b, i, 1), b)
Next
End If
End Sub
緣尉 好
回覆刪除程式OK
arro 好
程式OK
比賽時If Len(N) < 1 Or Len(N) > 10 Then
可以不用判斷題目輸入檔的錯誤OR正確