Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p "How many items do you want?"
- input = gets.to_i
- (1..input).each do |n|
- if n % 15 == 0
- p "FooBar"
- elsif n % 3 == 0
- p "Foo"
- elsif n % 5 == 0
- p "Bar"
- else
- p n
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement