Skip to content

Instantly share code, notes, and snippets.

@saml
Created August 29, 2012 20:44
Show Gist options
  • Save saml/3518686 to your computer and use it in GitHub Desktop.
Save saml/3518686 to your computer and use it in GitHub Desktop.
-module(tested).
-export([main/0]).
main() ->
io:get_line(""),
vfmul().
multiply(Line) ->
{X,[_|Ystr]} = string:to_integer(Line),
{Y,_} = string:to_integer(Ystr),
X + Y.
vfmul() ->
case io:get_line("") of
{error, Why} -> io:format(Why);
Line -> io:format("~w~n", [multiply(Line)]), vfmul()
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment