Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, n Call abc(n - 1, n, "") Close Close End End Sub Sub abc(a, b, c) If b = 0 Then Print #2, c Else For i = a To 1 Step -1 If b - i >= 0 Then Call abc(i, b - i, c & i) Next End If End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, n Call s(n - 1, n, "") Close #2 Close #1 End End Sub Sub s(s1, s2, s3) If s2 = 0 Then Print #2, s3 Else For i = s1 To 1 Step -1 If s2 - i >= 0 Then Call s(i, s2 - i, s3 & i) Next i End If End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Input #1, n Call x(n - 1, n, "") Close Close End End Sub Sub x(n1, n2, n3) If n2 = 0 Then Print #2, n3 Else For i = n1 To 1 Step -1 If n2 - i >= 0 Then Call x(i, n2 - i, n3 & i) Next End If End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, n
Call abc(n - 1, n, "")
Close
Close
End
End Sub
Sub abc(a, b, c)
If b = 0 Then
Print #2, c
Else
For i = a To 1 Step -1
If b - i >= 0 Then Call abc(i, b - i, c & i)
Next
End If
End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, n
Call s(n - 1, n, "")
Close #2
Close #1
End
End Sub
Sub s(s1, s2, s3)
If s2 = 0 Then
Print #2, s3
Else
For i = s1 To 1 Step -1
If s2 - i >= 0 Then Call s(i, s2 - i, s3 & i)
Next i
End If
End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Input #1, n
Call x(n - 1, n, "")
Close
Close
End
End Sub
Sub x(n1, n2, n3)
If n2 = 0 Then
Print #2, n3
Else
For i = n1 To 1 Step -1
If n2 - i >= 0 Then Call x(i, n2 - i, n3 & i)
Next
End If
End Sub