mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-15 19:28:47 +00:00
Included lama compilation in root's make regression target
This commit is contained in:
parent
52ef663986
commit
89536c67e0
3240 changed files with 14640 additions and 6 deletions
21
lama-compiler/regression/test036.lama
Normal file
21
lama-compiler/regression/test036.lama
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
var i, n, result;
|
||||
|
||||
fun fib (n) {
|
||||
var r;
|
||||
if n <= 1
|
||||
then result := 1
|
||||
else
|
||||
fib (n-1);
|
||||
r := result;
|
||||
fib (n-2);
|
||||
result := result + r
|
||||
fi
|
||||
}
|
||||
|
||||
n := read ();
|
||||
|
||||
for i := n, i >= 1, i := i-1 do
|
||||
fib (i);
|
||||
write (i);
|
||||
write (result)
|
||||
od
|
||||
Loading…
Add table
Add a link
Reference in a new issue