Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/Mutual-recursion/XPL0/mutual-recursion.xpl0
Normal file
18
Task/Mutual-recursion/XPL0/mutual-recursion.xpl0
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
code ChOut=8, CrLf=9, IntOut=11;
|
||||
|
||||
ffunc M; \forward-referenced function declaration
|
||||
|
||||
func F(N);
|
||||
int N;
|
||||
return if N=0 then 1 else N - M(F(N-1));
|
||||
|
||||
func M(N);
|
||||
int N;
|
||||
return if N=0 then 0 else N - F(M(N-1));
|
||||
|
||||
int I;
|
||||
[for I:= 0 to 19 do [IntOut(0, F(I)); ChOut(0, ^ )];
|
||||
CrLf(0);
|
||||
for I:= 0 to 19 do [IntOut(0, M(I)); ChOut(0, ^ )];
|
||||
CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue