Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Mutual-recursion/Liberty-BASIC/mutual-recursion.basic
Normal file
27
Task/Mutual-recursion/Liberty-BASIC/mutual-recursion.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
print "F sequence."
|
||||
for i = 0 to 20
|
||||
print f(i);" ";
|
||||
next
|
||||
print
|
||||
print "M sequence."
|
||||
for i = 0 to 20
|
||||
print m(i);" ";
|
||||
next
|
||||
|
||||
end
|
||||
|
||||
function f(n)
|
||||
if n = 0 then
|
||||
f = 1
|
||||
else
|
||||
f = n - m(f(n - 1))
|
||||
end if
|
||||
end function
|
||||
|
||||
function m(n)
|
||||
if n = 0 then
|
||||
m = 0
|
||||
else
|
||||
m = n - f(m(n - 1))
|
||||
end if
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue