puts "What year do you want to start?"
start_year = gets.chomp
puts "What year do you want to end ?"
end_year = gets.chomp
if start_year.to_i > end_year.to_i
puts "Starting year should smaller than ending year!"
else
puts "leap year between " + start_year + " and " + end_year +" :"
end
while start_year.to_i < end_year.to_i
while ((start_year.to_i%4 == 0 and start_year.to_i%100 != 0) or (start_year.to_i%100==0 and start_year.to_i%400 == 0))
puts start_year
start_year = start_year.to_i + 1 # 请问这里应该怎样理解呢?
end
start_year = start_year.to_i + 1 # 请问这里应该怎样理解呢?
end