9 lines
146 B
Elixir
9 lines
146 B
Elixir
|
|
defmodule NaturalNums do
|
||
|
|
def print(1), do: IO.puts(1)
|
||
|
|
|
||
|
|
def print(n) when is_integer(n) and n > 1 do
|
||
|
|
print(n - 1)
|
||
|
|
IO.puts(n)
|
||
|
|
end
|
||
|
|
end
|