結果

問題 No.163 cAPSlOCK
ユーザー da_louisda_louis
提出日時 2020-02-07 00:34:21
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 294 ms / 5,000 ms
コード長 211 bytes
コンパイル時間 12,511 ms
コンパイル使用メモリ 431,836 KB
実行使用メモリ 54,412 KB
最終ジャッジ日時 2023-10-25 22:52:26
合計ジャッジ時間 18,440 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 289 ms
54,392 KB
testcase_01 AC 290 ms
54,388 KB
testcase_02 AC 287 ms
54,396 KB
testcase_03 AC 287 ms
54,392 KB
testcase_04 AC 289 ms
54,412 KB
testcase_05 AC 288 ms
54,392 KB
testcase_06 AC 287 ms
54,400 KB
testcase_07 AC 284 ms
54,404 KB
testcase_08 AC 293 ms
54,400 KB
testcase_09 AC 287 ms
54,384 KB
testcase_10 AC 289 ms
54,392 KB
testcase_11 AC 289 ms
54,396 KB
testcase_12 AC 289 ms
54,380 KB
testcase_13 AC 286 ms
54,408 KB
testcase_14 AC 289 ms
54,404 KB
testcase_15 AC 290 ms
54,392 KB
testcase_16 AC 294 ms
54,412 KB
testcase_17 AC 293 ms
54,392 KB
testcase_18 AC 293 ms
54,400 KB
testcase_19 AC 290 ms
54,392 KB
testcase_20 AC 290 ms
54,396 KB
testcase_21 AC 289 ms
54,396 KB
testcase_22 AC 290 ms
54,412 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:8:49: warning: 'toUpperCase(): Char' is deprecated. Use uppercaseChar() instead.
    val answer = s.map { if (it in 'a'..'z') it.toUpperCase() else it.toLowerCase() }.joinToString("")
                                                ^
Main.kt:8:71: warning: 'toLowerCase(): Char' is deprecated. Use lowercaseChar() instead.
    val answer = s.map { if (it in 'a'..'z') it.toUpperCase() else it.toLowerCase() }.joinToString("")
                                                                      ^

ソースコード

diff #

fun main(args: Array<String>) {
    p339()
}

fun p339() {
    val s = readLine()!!

    val answer = s.map { if (it in 'a'..'z') it.toUpperCase() else it.toLowerCase() }.joinToString("")

    println(answer)
}
0