This website requires JavaScript.
Explore
Help
Sign In
kotovalexarian-likes-github
/
ruby--ruby
mirror of
https://github.com/ruby/ruby.git
Watch
1
Star
0
Fork
You've already forked ruby--ruby
0
Code
Releases
Activity
fd8991f797
ruby--ruby
/
sample
/
fact.rb
10 lines
111 B
Ruby
Raw
Blame
History
def
fact
(
n
)
return
1
if
n
==
0
f
=
1
n
.
downto
(
1
)
do
|
i
|
f
*=
i
end
f
end
puts
fact
(
ARGV
[
0
]
.
to_i
)
View Git Blame
Copy Permalink