|
??? |
|
Dim a(5) As Integer
Sub Macro1() Cells(1, 1).Value = 0 Call saiki(1) End Sub Sub saiki(ByVal n As Integer) Dim max As Integer, j As Integer If n = 1 Then max = 4 ElseIf a(n - 1) = 1 Then max = 4 Else max = 1 End If a(n) = 1 While a(n) <= max If n < 5 Then Call saiki(n + 1) Else Cells(1, 1).Value = Cells(1, 1).Value + 1 For j = 1 To 5 Cells(Cells(1, 1).Value, j + 1).Value = a(j) Next j End If a(n) = a(n) + 1 Wend End Sub |
|
2月25日(木) 9:58:52
44217 |