daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Nov 24th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. puts 'Pick a starting year (like 1973 or something):'
  2. starting = gets.chomp.to_i
  3.  
  4. puts 'Now pick an ending year:'
  5. ending   = gets.chomp.to_i
  6.  
  7. puts 'Check it out... these years are leap years:'
  8. (starting..ending).each do |year|
  9.                    != 0
  10.   next if year%4
  11.   next if year%100 == 0 && year%400 != 0
  12.   puts year
  13. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top