1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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.