-
-
Save Chuongv/c8b7d2741a80d1133a55 to your computer and use it in GitHub Desktop.
ProjectEuler5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listofnumbers=(20..1000000000) | |
def divisible?(x) | |
range=(1..10) | |
range.each {|y| | |
counter=0 | |
if x%y!=0 | |
break | |
else | |
x%y==0 | |
counter+=1 | |
if counter==10 | |
print x | |
break | |
end | |
end} | |
end | |
divisible?(2520) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment