結果

問題 No.163 cAPSlOCK
ユーザー dazydazy
提出日時 2016-09-02 00:56:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 595 bytes
コンパイル時間 3,006 ms
コンパイル使用メモリ 71,612 KB
実行使用メモリ 57,732 KB
最終ジャッジ日時 2023-08-09 19:58:08
合計ジャッジ時間 6,493 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
56,072 KB
testcase_01 AC 116 ms
55,656 KB
testcase_02 AC 116 ms
55,332 KB
testcase_03 AC 118 ms
55,668 KB
testcase_04 AC 119 ms
55,740 KB
testcase_05 AC 116 ms
55,672 KB
testcase_06 AC 117 ms
55,632 KB
testcase_07 AC 118 ms
55,712 KB
testcase_08 AC 117 ms
56,040 KB
testcase_09 AC 118 ms
55,716 KB
testcase_10 AC 118 ms
56,160 KB
testcase_11 AC 116 ms
55,936 KB
testcase_12 AC 116 ms
55,636 KB
testcase_13 AC 118 ms
55,856 KB
testcase_14 AC 116 ms
55,764 KB
testcase_15 AC 117 ms
55,536 KB
testcase_16 AC 119 ms
56,128 KB
testcase_17 AC 120 ms
55,844 KB
testcase_18 AC 116 ms
55,812 KB
testcase_19 AC 116 ms
55,632 KB
testcase_20 AC 116 ms
55,352 KB
testcase_21 AC 117 ms
57,732 KB
testcase_22 AC 117 ms
56,088 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