Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/Mutual-recursion/VBA/mutual-recursion.vba
Normal file
26
Task/Mutual-recursion/VBA/mutual-recursion.vba
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
Private Function F(ByVal n As Integer) As Integer
|
||||
If n = 0 Then
|
||||
F = 1
|
||||
Else
|
||||
F = n - M(F(n - 1))
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function M(ByVal n As Integer) As Integer
|
||||
If n = 0 Then
|
||||
M = 0
|
||||
Else
|
||||
M = n - F(M(n - 1))
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Sub MR()
|
||||
Dim i As Integer
|
||||
For i = 0 To 20
|
||||
Debug.Print F(i);
|
||||
Next i
|
||||
Debug.Print
|
||||
For i = 0 To 20
|
||||
Debug.Print M(i);
|
||||
Next i
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue