Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Mutual-recursion/IS-BASIC/mutual-recursion.basic
Normal file
23
Task/Mutual-recursion/IS-BASIC/mutual-recursion.basic
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
100 PROGRAM "Hofstad.bas"
|
||||
110 PRINT "F sequence:"
|
||||
120 FOR I=0 TO 20
|
||||
130 PRINT F(I);
|
||||
140 NEXT
|
||||
150 PRINT :PRINT "M sequence:"
|
||||
160 FOR I=0 TO 20
|
||||
170 PRINT M(I);
|
||||
180 NEXT
|
||||
190 DEF F(N)
|
||||
200 IF N=0 THEN
|
||||
210 LET F=1
|
||||
220 ELSE
|
||||
230 LET F=N-M(F(N-1))
|
||||
240 END IF
|
||||
250 END DEF
|
||||
260 DEF M(N)
|
||||
270 IF N=0 THEN
|
||||
280 LET M=0
|
||||
290 ELSE
|
||||
300 LET M=N-F(M(N-1))
|
||||
310 END IF
|
||||
320 END DEF
|
||||
Loading…
Add table
Add a link
Reference in a new issue