defmodule Main do def main do n = IO.gets("") |> String.trim |> String.to_integer Enum.to_list(1..n) |> Enum.map(&fizzbuzz/1) end def fizzbuzz(n) when rem(n, 15) === 0, do: IO.puts("FizzBuzz") def fizzbuzz(n) when rem(n, 3) === 0, do: IO.puts("Fizz") def fizzbuzz(n) when rem(n, 5) === 0, do: IO.puts("Buzz") def fizzbuzz(n), do: IO.puts(n) end