Created
March 5, 2017 05:12
-
-
Save takoikatakotako/08ecaa1c16ccb1c67603755e2d973dc9 to your computer and use it in GitHub Desktop.
FizzBuzzをRubyで解きました。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for num in 1..20 do | |
| if num%3 == 0 && num%5 == 0 then | |
| puts('Fizz Buzz') | |
| elsif num%3 == 0 then | |
| puts('Fizz') | |
| elsif num%5 == 0 | |
| puts('Buzz') | |
| else | |
| puts(num) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment