mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
8 lines
96 B
Ruby
8 lines
96 B
Ruby
def fact(n)
|
|
if n == 0
|
|
1
|
|
else
|
|
n * fact(n-1)
|
|
end
|
|
end
|
|
print fact(ARGV[0].to_i), "\n"
|