You are viewing a single comment's thread. Return to all comments →
Erlang Solution:
-module(solution). -export([main/0]). read(T)-> case io:fread("","~d") of {ok,[H]} -> read([H|T]); _ -> T end. output(L,S) -> if S=:=0-> ok; S>-1 -> [H|T] = L, io:format("~p~n",[H]), output(T,S-1) end. main() -> Li = read([]), S=length(Li), output(Li,S).
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a List
You are viewing a single comment's thread. Return to all comments →
Erlang Solution: