結果

問題 No.163 cAPSlOCK
ユーザー jonki324jonki324
提出日時 2018-06-03 16:02:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 513 bytes
コンパイル時間 1,892 ms
コンパイル使用メモリ 71,036 KB
実行使用メモリ 56,196 KB
最終ジャッジ日時 2023-09-12 21:53:43
合計ジャッジ時間 5,747 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,780 KB
testcase_01 AC 117 ms
56,032 KB
testcase_02 AC 117 ms
55,936 KB
testcase_03 AC 120 ms
56,084 KB
testcase_04 AC 119 ms
55,968 KB
testcase_05 AC 116 ms
56,196 KB
testcase_06 AC 118 ms
55,928 KB
testcase_07 AC 117 ms
56,072 KB
testcase_08 AC 116 ms
55,964 KB
testcase_09 AC 117 ms
56,076 KB
testcase_10 AC 117 ms
55,748 KB
testcase_11 AC 118 ms
55,816 KB
testcase_12 AC 117 ms
55,680 KB
testcase_13 AC 119 ms
54,192 KB
testcase_14 AC 119 ms
55,704 KB
testcase_15 AC 119 ms
56,016 KB
testcase_16 AC 119 ms
55,736 KB
testcase_17 AC 119 ms
55,588 KB
testcase_18 AC 119 ms
55,824 KB
testcase_19 AC 117 ms
55,608 KB
testcase_20 AC 118 ms
55,736 KB
testcase_21 AC 118 ms
55,716 KB
testcase_22 AC 124 ms
56,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        char[] c = s.toCharArray();
        for (int i = 0; i < c.length; i++) {
            if (Character.isLowerCase(c[i])) {
                c[i] = Character.toUpperCase(c[i]);
            } else {
                c[i] = Character.toLowerCase(c[i]);
            }
        }
        System.out.println(new String(c));
        scan.close();
    }
}
0