Created
March 4, 2019 05:21
-
-
Save SAMMY7th/8c55093b7e72973f94d15d0b8c35b208 to your computer and use it in GitHub Desktop.
就活GeekHub 提出ページ例です。 (例:ScalaでFizzBuzz)
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
object FizzBuzz extends App { | |
val result = (1 to 100).map { | |
case x if x % 3 == 0 && x % 5 == 0 => "FizzBuzz" | |
case x if x % 3 == 0 => "Fizz" | |
case x if x % 5 == 0 => "Buzz" | |
case x => x | |
} | |
result.foreach(println) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment