adding ignore and first exo in ruby
This commit is contained in:
parent
7e6ef4c4c7
commit
89a7d27ed5
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
notes\ cours\ python
|
1
ruby_algo/README.md
Normal file
1
ruby_algo/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
Resolution for projet euler in ruby
|
4
ruby_algo/ex1.rb
Normal file
4
ruby_algo/ex1.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Solution for the sum of all number multiple of 3 or 5 between 1 and 999
|
||||
|
||||
sum = (1..999).select {|n| n % 5 == 0 || n % 3 == 0}
|
||||
sum.inject(:+)
|
Loading…
Reference in a new issue