2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
15
Task/Anonymous-recursion/ALGOL-68/anonymous-recursion.alg
Normal file
15
Task/Anonymous-recursion/ALGOL-68/anonymous-recursion.alg
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
PROC fibonacci = ( INT x )INT:
|
||||
IF x < 0
|
||||
THEN
|
||||
print( ( "negative parameter to fibonacci", newline ) );
|
||||
stop
|
||||
ELSE
|
||||
PROC actual fibonacci = ( INT n )INT:
|
||||
IF n < 2
|
||||
THEN
|
||||
n
|
||||
ELSE
|
||||
actual fibonacci( n - 1 ) + actual fibonacci( n - 2 )
|
||||
FI;
|
||||
actual fibonacci( x )
|
||||
FI;
|
||||
Loading…
Add table
Add a link
Reference in a new issue