Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. p "How many items do you want?"
  2. input = gets.to_i
  3.  
  4. (1..input).each do |n|
  5. if n % 15 == 0
  6. p "FooBar"
  7. elsif n % 3 == 0
  8. p "Foo"
  9. elsif n % 5 == 0
  10. p "Bar"
  11. else
  12. p n
  13. end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement