結果

問題 No.784 「,(カンマ)」
ユーザー ktgw0316ktgw0316
提出日時 2019-03-30 23:01:52
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 277 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 11,713 ms
コンパイル使用メモリ 415,792 KB
実行使用メモリ 50,444 KB
最終ジャッジ日時 2023-08-13 01:30:26
合計ジャッジ時間 16,351 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 270 ms
50,216 KB
testcase_01 AC 271 ms
49,976 KB
testcase_02 AC 271 ms
50,128 KB
testcase_03 AC 270 ms
50,152 KB
testcase_04 AC 269 ms
50,112 KB
testcase_05 AC 272 ms
50,444 KB
testcase_06 AC 271 ms
50,108 KB
testcase_07 AC 273 ms
50,116 KB
testcase_08 AC 277 ms
50,124 KB
testcase_09 AC 274 ms
50,072 KB
testcase_10 AC 270 ms
50,288 KB
testcase_11 AC 268 ms
50,204 KB
testcase_12 AC 273 ms
50,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val str = readLine()!!
    val length = str.length
    val shift = 3 - length % 3

    print(str[0])
    for (i in 1 until length) {
        if ((i + shift) % 3 == 0) print(",")
        print(str[i])
    }
    print("\n")
}
0