aboutsummaryrefslogtreecommitdiff
path: root/problem8.erl
diff options
context:
space:
mode:
Diffstat (limited to 'problem8.erl')
-rwxr-xr-xproblem8.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/problem8.erl b/problem8.erl
new file mode 100755
index 0000000..fdc83ac
--- /dev/null
+++ b/problem8.erl
@@ -0,0 +1,18 @@
+-module(problem8).
+-export([solve/0]).
+-import(problem8a,[getnum/0]).
+
+solve() ->
+ work(getnum(),0).
+
+
+work([_,_,_,_],Acc) ->
+ Acc;
+work([A,B,C,D,E|T],Acc) ->
+ F = A*B*C*D*E,
+ if
+ F > Acc ->
+ work([B,C,D,E|T],F);
+ true ->
+ work([B,C,D,E|T],Acc)
+ end.