結果

問題 No.656 ゴルフ
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2018-04-14 21:57:57
言語 Scala(Beta)
(3.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 245 bytes
コンパイル時間 6,772 ms
コンパイル使用メモリ 224,984 KB
最終ジャッジ日時 2024-04-27 02:32:52
合計ジャッジ時間 7,211 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
-- Error: Main.scala:5:8 -------------------------------------------------------
5 |        var sum = 0;
  |        ^
  |     Incompatible combinations of tabs and spaces in indentation prefixes.
  |     Previous indent : 2 tabs
  |     Latest indent   : 8 spaces
-- Error: Main.scala:6:8 -------------------------------------------------------
6 |        for (c <- s) {
  |        ^
  |     Incompatible combinations of tabs and spaces in indentation prefixes.
  |     Previous indent : 2 tabs
  |     Latest indent   : 8 spaces
-- Error: Main.scala:10:8 ------------------------------------------------------
10 |        println(sum);
   |        ^
   |   Incompatible combinations of tabs and spaces in indentation prefixes.
   |   Previous indent : 2 tabs
   |   Latest indent   : 8 spaces
3 errors found

ソースコード

diff #

object Main {

	def main(arg:Array[String]) = {
		val s = scala.io.StdIn.readLine();
        var sum = 0;
        for (c <- s) {
          if (c != '0') sum = sum + (c - '0');
          else sum = sum + 10;
        }
        println(sum);
	}

}
0