結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー noriocnorioc
提出日時 2015-08-16 21:25:34
言語 Scala(Beta)
(3.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 428 bytes
コンパイル時間 6,276 ms
コンパイル使用メモリ 217,892 KB
最終ジャッジ日時 2023-09-11 12:07:41
合計ジャッジ時間 6,917 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
-- [E040] Syntax Error: Main.scala:7:32 ----------------------------------------
7 |  def main(args: Array[String]) {
  |                                ^
  |                                '=' expected, but '{' found
1 error found

ソースコード

diff #

object Main {
  val sc = new java.util.Scanner(System.in)
  def readLine(): String = sc.nextLine
  def readInts(): Array[Int] = sc.nextLine.split(' ').map(_.toInt)
  def readInt(): Int = sc.nextLine.toInt

  def main(args: Array[String]) {
    val k = readInt
    var n = 0
    for (i <- Array(2, 3, 5, 7, 11, 13);
         j <- Array(4, 6, 8, 9, 10, 12)
         if k == i * j) {
      n += 1
    }
    println(n / 36.0)
  }
}
0