This website requires JavaScript.
Explore
Help
Sign In
cosmonaut
/
euler
Watch
1
Star
0
Fork
You've already forked euler
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
f4223215b1
euler
/
ruby
/
euler020.rb
6 lines
100 B
Ruby
Raw
Blame
History
def
factorial
(
n
)
(
1
..
n
)
.
inject
(
:*
)
end
puts
factorial
(
100
)
.
to_s
.
split
(
"
"
)
.
map
(
&
:to_i
)
.
inject
(
:+
)
Reference in New Issue
View Git Blame
Copy Permalink