結果

問題 No.163 cAPSlOCK
ユーザー minokasagominokasago
提出日時 2019-11-01 13:42:33
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 282 ms / 5,000 ms
コード長 293 bytes
コンパイル時間 12,102 ms
コンパイル使用メモリ 408,532 KB
実行使用メモリ 50,740 KB
最終ジャッジ日時 2023-10-13 00:43:10
合計ジャッジ時間 20,499 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 274 ms
50,252 KB
testcase_01 AC 271 ms
50,272 KB
testcase_02 AC 272 ms
50,280 KB
testcase_03 AC 277 ms
50,408 KB
testcase_04 AC 274 ms
50,284 KB
testcase_05 AC 269 ms
50,276 KB
testcase_06 AC 274 ms
50,124 KB
testcase_07 AC 270 ms
50,256 KB
testcase_08 AC 270 ms
50,284 KB
testcase_09 AC 273 ms
50,284 KB
testcase_10 AC 279 ms
50,212 KB
testcase_11 AC 274 ms
50,552 KB
testcase_12 AC 280 ms
50,416 KB
testcase_13 AC 277 ms
50,228 KB
testcase_14 AC 271 ms
50,280 KB
testcase_15 AC 276 ms
50,112 KB
testcase_16 AC 277 ms
50,188 KB
testcase_17 AC 282 ms
50,556 KB
testcase_18 AC 274 ms
50,284 KB
testcase_19 AC 270 ms
50,740 KB
testcase_20 AC 273 ms
50,148 KB
testcase_21 AC 273 ms
50,284 KB
testcase_22 AC 274 ms
50,116 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:11:26: warning: 'toLowerCase(): Char' is deprecated. Use lowercaseChar() instead.
            sb.append(it.toLowerCase())
                         ^
Main.kt:13:26: warning: 'toUpperCase(): Char' is deprecated. Use uppercaseChar() instead.
            sb.append(it.toUpperCase())
                         ^

ソースコード

diff #

import kotlin.math.*
//import kotlin.text.*

fun main()
{
    val S = readLine()!!
    val sb = StringBuilder()

    S.forEach {
        if (it.isUpperCase()) {
            sb.append(it.toLowerCase())
        } else {
            sb.append(it.toUpperCase())
        }
    }

    println(sb)
}
0