結果

問題 No.163 cAPSlOCK
ユーザー SaYaSaYa
提出日時 2015-11-08 19:20:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 550 bytes
コンパイル時間 3,073 ms
コンパイル使用メモリ 71,608 KB
実行使用メモリ 55,976 KB
最終ジャッジ日時 2023-10-11 15:21:10
合計ジャッジ時間 6,954 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
53,376 KB
testcase_01 AC 121 ms
55,420 KB
testcase_02 AC 121 ms
55,560 KB
testcase_03 AC 122 ms
55,644 KB
testcase_04 AC 121 ms
55,536 KB
testcase_05 AC 120 ms
55,768 KB
testcase_06 AC 120 ms
55,676 KB
testcase_07 AC 120 ms
55,632 KB
testcase_08 AC 121 ms
55,804 KB
testcase_09 AC 122 ms
55,644 KB
testcase_10 AC 121 ms
55,844 KB
testcase_11 AC 120 ms
55,544 KB
testcase_12 AC 119 ms
55,624 KB
testcase_13 AC 120 ms
55,532 KB
testcase_14 AC 120 ms
55,500 KB
testcase_15 AC 120 ms
55,244 KB
testcase_16 AC 121 ms
55,976 KB
testcase_17 AC 120 ms
55,652 KB
testcase_18 AC 120 ms
55,280 KB
testcase_19 AC 119 ms
55,504 KB
testcase_20 AC 119 ms
55,280 KB
testcase_21 AC 120 ms
55,496 KB
testcase_22 AC 122 ms
55,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();

        StringBuilder builder = new StringBuilder();

        for (char c : s.toCharArray()) {
            if (Character.isUpperCase(c)) {
                builder.append(String.valueOf(c).toLowerCase());
            } else {
                builder.append(String.valueOf(c).toUpperCase());
            }
        }

        System.out.println(builder.toString());
    }
}
0