gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c85507)
raw | patch | inline | side by side (parent: 5c85507)
author | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 9 Feb 2014 00:05:03 +0000 (01:05 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 9 Feb 2014 00:05:03 +0000 (01:05 +0100) |
samples/RekFac.mj | [new file with mode: 0644] | patch | blob |
diff --git a/samples/RekFac.mj b/samples/RekFac.mj
--- /dev/null
+++ b/samples/RekFac.mj
@@ -0,0 +1,15 @@
+program RekFac{
+
+ int factorial(int f)
+ {
+ if (f<0) return 0;
+ if (f<=1) return 1;
+ return factorial(f-1) * f ;
+ }
+
+ void main()
+ {
+ print(factorial(3),3);
+ print(factorial(10),10);
+ }
+}
\ No newline at end of file