defmodule Main do def main do [year, month, day] = IO.gets("") |> String.trim |> String.split("/") |> Enum.map(&String.to_integer/1) {:ok, date} = Date.new(year, month, day) next_day = Date.add(date, 2) |> Date.to_string IO.puts Regex.replace(~r/-/, next_day, "/") end end