Skip to content

Instantly share code, notes, and snippets.

@keizo042
Last active August 29, 2015 13:57
Show Gist options
  • Save keizo042/9382698 to your computer and use it in GitHub Desktop.
Save keizo042/9382698 to your computer and use it in GitHub Desktop.
FizzBuzzをscalaで書いた。分かりやすく書けて割りと気に入っている。そういうお題じゃないとも思う。
(1 to 100).foreach{ i =>
printf("%d",i)
if(i % 3 == 0) printf("Fizz")
if(i % 5 == 0) printf("Buzz")
printf(" ")}
println
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment