You are viewing a single comment's thread. Return to all comments →
Struggled a lot for input handling, here is some reference for those having a hard time with erlang.
input(L) -> case io:fread("", "~d") of {ok, [N]} -> input([N|L]); _ -> lists:reverse(L) end. output(L) -> [io:fwrite("~w~n", [H]) || H<-L].
The actual solution with list comprehension is easy as haskell:
[N || N <- X , _ <- lists:seq(1,S)]
Seems like cookies are disabled on this browser, please enable them to open this website
List Replication
You are viewing a single comment's thread. Return to all comments →
Struggled a lot for input handling, here is some reference for those having a hard time with erlang.
The actual solution with list comprehension is easy as haskell: