10 lines
81 B
Ruby
10 lines
81 B
Ruby
def fact(x)
|
|
if x == 1
|
|
1
|
|
else
|
|
x * fact(x - 1)
|
|
end
|
|
end
|
|
|
|
puts fact(5)
|