A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
18
Task/Fibonacci-sequence/ALGOL-68/fibonacci-sequence-4.alg
Normal file
18
Task/Fibonacci-sequence/ALGOL-68/fibonacci-sequence-4.alg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
MODE YIELDINT = PROC(INT)VOID;
|
||||
|
||||
PROC gen fibonacci = (INT n, YIELDINT yield)VOID: (
|
||||
INT even:=0, odd:=1;
|
||||
yield(even);
|
||||
yield(odd);
|
||||
FOR i FROM odd+1 TO n DO
|
||||
yield( (ODD i|odd|even) := odd + even )
|
||||
OD
|
||||
);
|
||||
|
||||
main:(
|
||||
# FOR INT n IN # gen fibonacci(30, # ) DO ( #
|
||||
## (INT n)VOID:(
|
||||
print((" ",whole(n,0)))
|
||||
# OD # ));
|
||||
print(new line)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue