You are viewing a single comment's thread. Return to all comments →
Erlang solution:
-module(solution). -export([main/0]). read(X) -> case io:fread("", "~d") of eof -> ok; {ok, [N]} -> if (X rem 2=/=0)-> io:format("~p~n", [N]); (X rem 2 =:=0)-> ok end, read(X+1) end. main() -> {ok,[X]} = io:fread("", "~d"), read(1).
Seems like cookies are disabled on this browser, please enable them to open this website
Filter Positions in a List
You are viewing a single comment's thread. Return to all comments →
Erlang solution: