up vote
2
Private Sub Command1_Click()
Dim a As String
a = Trim(InputBox("請輸入字串", , "123"))
If a = "" Then Exit Sub
ReDim c(1 To Len(a)) As Boolean
cal a, "", c
End SubSub cal(a As String, s As String, c() As Boolean)
If Len(s) = Len(a) Then Print s: Exit Sub
Dim i As Integer, tmp() As Boolean
For i = 1 To Len(a)
If Not c(i) Then
tmp = c: tmp(i) = True
cal a, s & Mid(a, i, 1), tmp
End If
Next
End Sub
會員登入
(先登入會員才能回覆留言喔!)