結果

問題 No.163 cAPSlOCK
ユーザー minokasago
提出日時 2019-11-01 13:42:33
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 294 ms / 5,000 ms
コード長 293 bytes
コンパイル時間 11,416 ms
コンパイル使用メモリ 429,892 KB
実行使用メモリ 49,788 KB
最終ジャッジ日時 2024-09-14 22:37:25
合計ジャッジ時間 19,160 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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