Advertisement
iAnonGuy

~ Odd or Even?

Feb 3rd, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.79 KB | None | 0 0
  1. puts "   ____      _     _            ______              ___  "
  2. puts "  / __ \\    | |   | |          |  ____|            |__ \\ "
  3. puts " | |  | | __| | __| |  ______  | |____   _____ _ __   ) |"
  4. puts " | |  | |/ _` |/ _` | |______| |  __\\ \\ / / _ \\ '_ \\ / / "
  5. puts " | |__| | (_| | (_| |          | |___\\ V /  __/ | | |_|  "
  6. puts "  \\____/ \\__,_|\\__,_|          |______\\_/ \\___|_| |_(_)  "                                                      
  7. puts "                                                         ~ AnonGuy"                        
  8. print "\nInput ~ "
  9. input = gets.chomp.reverse
  10. input.each_line do |line|
  11.   splits = line.split("")
  12.   for split in splits
  13.   int = split.to_i
  14.   if int.odd?
  15.     puts "#{int} is Odd!"
  16.   elsif int.even?
  17.     puts "#{int} is Even!"
  18.   end
  19. end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement