aboutsummaryrefslogtreecommitdiff
path: root/p20e
blob: 34f984d87206ac1870540eef5db13da6273323c2 (plain)
1
2
3
4
#! /usr/bin/env escript

main(_) -> io:format("~w~n",[lists:sum([X-48 || X <- integer_to_list(fact(100))])]).
fact(1) -> 1; fact(X) -> X * fact(X-1).