Skip to content

Instantly share code, notes, and snippets.

@kmizu
Last active May 27, 2020 06:16
Show Gist options
  • Save kmizu/c937113610b7bdf9718d202379e9f9b7 to your computer and use it in GitHub Desktop.
Save kmizu/c937113610b7bdf9718d202379e9f9b7 to your computer and use it in GitHub Desktop.
FizzBuzz class problem in Scala

整数mから整数n(n >= 1、m >= 1)までのFizzBuzzを計算せよ。ただし、FizzBuzzのクラス定義は次のようになっていなければいけないものとする。

なお、剰余は x % y、 数値の文字列化は num.toString で可能である。

case class FizzBuzz(val m: Int, val n: Int) {
  def call(): Unit = {
    ???
  }
}
val fizzBuzz(1, 100)
fizzBuzz.call()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment