ruby - leap

This commit is contained in:
2018-09-16 15:09:35 -04:00
parent 3eafeeb73a
commit 2caa27befc
3 changed files with 96 additions and 0 deletions

5
ruby/leap/leap.rb Normal file
View File

@ -0,0 +1,5 @@
class Year
def self.leap?(year)
(year % 4 == 0 and (year % 400 == 0 or year % 100 != 0))
end
end