Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/ruby

def is_leap_year (year)
return year%4 == 0 && year%100 !=0 || year%400 == 0
end

def print_next_leap_years (amount, year)
$printed = 0
while $printed < amount do
year += 1
if is_leap_year(year)
$printed += 1
puts year
end
end
end

print_next_leap_years(30, 1999)