結果

問題 No.163 cAPSlOCK
ユーザー dazydazy
提出日時 2016-09-02 00:56:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 595 bytes
コンパイル時間 2,293 ms
コンパイル使用メモリ 75,080 KB
実行使用メモリ 54,344 KB
最終ジャッジ日時 2024-04-27 14:32:18
合計ジャッジ時間 6,416 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,344 KB
testcase_01 AC 137 ms
53,908 KB
testcase_02 AC 138 ms
53,944 KB
testcase_03 AC 135 ms
54,024 KB
testcase_04 AC 136 ms
53,932 KB
testcase_05 AC 138 ms
54,308 KB
testcase_06 AC 134 ms
53,844 KB
testcase_07 AC 139 ms
54,244 KB
testcase_08 AC 138 ms
53,920 KB
testcase_09 AC 133 ms
54,132 KB
testcase_10 AC 135 ms
53,964 KB
testcase_11 AC 134 ms
53,740 KB
testcase_12 AC 138 ms
54,104 KB
testcase_13 AC 135 ms
53,876 KB
testcase_14 AC 135 ms
53,976 KB
testcase_15 AC 134 ms
54,060 KB
testcase_16 AC 139 ms
54,228 KB
testcase_17 AC 135 ms
54,016 KB
testcase_18 AC 136 ms
54,020 KB
testcase_19 AC 132 ms
53,824 KB
testcase_20 AC 135 ms
54,092 KB
testcase_21 AC 140 ms
53,912 KB
testcase_22 AC 139 ms
54,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Yukicoder {
    static public void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder S = new StringBuilder();
        S.append(scanner.next());

        if (S.length() < 1 || S.length() > 100) System.exit(1);

        char tmp;
        for (int i = 0; i < S.length(); i++) {
            tmp = S.charAt(i);
            if (Character.isLowerCase(tmp)) tmp = Character.toUpperCase(tmp);
            else tmp = Character.toLowerCase(tmp);
            S.setCharAt(i, tmp);
        }

        System.out.println(S);
    }
}
0