diff --git a/solutions/d1000000.ex b/solutions/d1000000.ex new file mode 100644 index 00000000..ecd5ef91 --- /dev/null +++ b/solutions/d1000000.ex @@ -0,0 +1,17 @@ +dice = IO.gets("") +di= String.to_integer(dice) +_array = IO.read(:stdio, :line) +#array +# |> String.split(" ") +# |> Enum.map(fn n -> String.to_integer(n) end) +# |> IO.inspect +cont=Enum.reduce( + [6,10,12,8], # input + {0}, # initial accumulator + fn x, {ac} -> + cond do + x>di -> {ac+1} + end +end) +IO.puts("Case #1:") +IO.inspect(cont) \ No newline at end of file