defmodule Main do
def main do
list = %{"100" => 1, "50" => 2, "20" => 4, "10" => 8, "5" => 16, "1" => 32}
IO.inspect Enum.map(list, fn{key, value} -> String.to_integer(key) * value end) , char_lists: :as_lists
for {key
, value
} <- list
, do: IO.
puts String.
to_integer(key
) * value
end
end
Main.main
ZGVmbW9kdWxlIE1haW4gZG8KICBkZWYgbWFpbiBkbwogICAgbGlzdCA9ICV7IjEwMCIgPT4gMSwgIjUwIiA9PiAyLCAiMjAiID0+IDQsICIxMCIgPT4gOCwgIjUiID0+IDE2LCAiMSIgPT4gMzJ9CiAgICBJTy5pbnNwZWN0IEVudW0ubWFwKGxpc3QsIGZue2tleSwgdmFsdWV9IC0+IFN0cmluZy50b19pbnRlZ2VyKGtleSkgKiB2YWx1ZSBlbmQpICwgY2hhcl9saXN0czogOmFzX2xpc3RzCglmb3Ige2tleSwgdmFsdWV9IDwtIGxpc3QsIGRvOiBJTy5wdXRzIFN0cmluZy50b19pbnRlZ2VyKGtleSkgKiB2YWx1ZQogIGVuZAplbmQKIApNYWluLm1haW4K