From 7199f28d1e4d4820dbc0f95c10f6062b436db2b2 Mon Sep 17 00:00:00 2001 From: Denia Lomas <50151794+dennxa@users.noreply.github.com> Date: Fri, 4 Nov 2022 03:22:38 -0700 Subject: [PATCH] add file via upload --- solutions/d1000000.ex | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 solutions/d1000000.ex 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