結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-10-06 16:33:43
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 157 bytes
コンパイル時間 12,454 ms
コンパイル使用メモリ 431,512 KB
実行使用メモリ 49,832 KB
最終ジャッジ日時 2024-04-21 21:48:51
合計ジャッジ時間 21,306 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 301 ms
49,812 KB
testcase_01 AC 291 ms
49,708 KB
testcase_02 AC 289 ms
49,772 KB
testcase_03 AC 290 ms
49,668 KB
testcase_04 AC 289 ms
49,600 KB
testcase_05 AC 289 ms
49,584 KB
testcase_06 AC 294 ms
49,792 KB
testcase_07 AC 289 ms
49,828 KB
testcase_08 AC 293 ms
49,760 KB
testcase_09 AC 291 ms
49,592 KB
testcase_10 AC 288 ms
49,728 KB
testcase_11 AC 289 ms
49,728 KB
testcase_12 AC 297 ms
49,712 KB
testcase_13 AC 294 ms
49,720 KB
testcase_14 AC 290 ms
49,640 KB
testcase_15 AC 292 ms
49,788 KB
testcase_16 AC 296 ms
49,656 KB
testcase_17 AC 291 ms
49,804 KB
testcase_18 AC 293 ms
49,604 KB
testcase_19 AC 319 ms
49,652 KB
testcase_20 AC 302 ms
49,640 KB
testcase_21 AC 303 ms
49,832 KB
testcase_22 AC 289 ms
49,728 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val S = readLine()!!
    var ans = 0

    S.forEach { c ->
        ans += c.toString().toInt()
    }

    println(ans)
}
0