刚入门的可以先看看Erlang基础
-module(search).
-compile(export_all).
max([H|T])->get_max(T,H).
get_max([],Result)->Result;
get_max([H|T],Result) when H>Result ->get_max(T,H);
get_max([H|T],Result)->get_max(T,Result).
刚入门的可以先看看Erlang基础
-module(search).
-compile(export_all).
max([H|T])->get_max(T,H).
get_max([],Result)->Result;
get_max([H|T],Result) when H>Result ->get_max(T,H);
get_max([H|T],Result)->get_max(T,Result).