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