algorithm-in-python/parser/PL0-compiler/test/txt/fibonacci.txt

17 lines
205 B
Plaintext
Raw Normal View History

2019-03-15 16:37:02 +08:00
func fib(n)
begin
if n=1 || n=2 then return 1;
return fib(n-1)+fib(n-2);
end ;
var n=1;
begin
while n<15 do
begin
print('fib[%d]=%d',n,fib(n));
n :=n+1;
end;
end
.