結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー ぴろずぴろず
提出日時 2015-03-30 02:26:32
言語 Scala(Beta)
(3.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 314 bytes
コンパイル時間 7,429 ms
コンパイル使用メモリ 297,040 KB
最終ジャッジ日時 2024-04-27 02:07:16
合計ジャッジ時間 7,710 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
-- [E040] Syntax Error: Main.scala:3:31 ----------------------------------------
3 |    print((1 to readLine.toInt toList).map((i:Int) => i match {
  |                               ^^^^^^
  |                               ',' or ')' expected, but identifier found
-- [E006] Not Found Error: Main.scala:3:16 -------------------------------------
3 |    print((1 to readLine.toInt toList).map((i:Int) => i match {
  |                ^^^^^^^^
  |                Not found: readLine
  |
  | longer explanation available when compiling with `-explain`
-- [E008] Not Found Error: Main.scala:8:32 -------------------------------------
8 |    }).foldRight("")((x,y) => x + "\n" + y))
  |                              ^^^
  |value + is not a member of String | Int, but could be made available as an extension method.
  |
  |One of the following imports might make progress towards fixing the problem:
  |
  |  import scala.math.Fractional.Implicits.infixFractionalOps
  |  import scala.math.Integral.Implicits.infixIntegralOps
  |  import scala.math.Numeric.Implicits.infixNumericOps
  |
3 errors found

ソースコード

diff #

object Main {
  def main(args:Array[String]) = {
    print((1 to readLine.toInt toList).map((i:Int) => i match {
      case x if x % 15 == 0 => "FizzBuzz"
      case x if x % 3  == 0 => "Fizz"
      case x if x % 5  == 0 => "Buzz"
      case x                => x
    }).foldRight("")((x,y) => x + "\n" + y))
  }
}
0