-module(helloworld).
-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]).
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266256.html
-module(helloworld).
-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]).
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266256.html