This commit is contained in:
louiscklaw
2025-02-01 02:01:54 +08:00
parent a767348238
commit d6e3882dd7
188 changed files with 43536 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
-module(recursion).
-export([fac/1,start/0]).
fac(N) when N == 0 -> 1;
fac(N) when N > 0 -> N*fac(N-1).
start() ->
X = fac(4),
io:fwrite("~w",[X]).