From: Doni Pracner Date: Sat, 4 Jan 2014 22:39:29 +0000 (+0100) Subject: new sample - RekFib X-Git-Tag: v0.1.4~48 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=27987606881f12aa387b6c978b56433cf9170fdb;p=mjc2wsl.git new sample - RekFib --- diff --git a/samples/RekFib.mj b/samples/RekFib.mj new file mode 100644 index 0000000..1c297e5 --- /dev/null +++ b/samples/RekFib.mj @@ -0,0 +1,16 @@ +program RekFib{ + + int fib(int f) + { + if (f==0) return 0; + if (f==1) return 1; + return fib(f-1)+fib(f-2) ; + } + + void main() + int i; + { + print(fib(0)); + print(fib(7)); + } +} \ No newline at end of file