結果

問題 No.163 cAPSlOCK
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-29 20:49:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 721 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 71,740 KB
実行使用メモリ 49,724 KB
最終ジャッジ日時 2023-10-11 20:26:15
合計ジャッジ時間 5,077 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
47,016 KB
testcase_01 AC 43 ms
49,244 KB
testcase_02 AC 45 ms
49,048 KB
testcase_03 AC 45 ms
49,104 KB
testcase_04 AC 45 ms
49,280 KB
testcase_05 AC 45 ms
48,904 KB
testcase_06 AC 44 ms
49,132 KB
testcase_07 AC 45 ms
49,400 KB
testcase_08 AC 45 ms
49,136 KB
testcase_09 AC 45 ms
49,052 KB
testcase_10 AC 45 ms
49,372 KB
testcase_11 AC 45 ms
49,112 KB
testcase_12 AC 44 ms
49,088 KB
testcase_13 AC 45 ms
49,100 KB
testcase_14 AC 45 ms
49,724 KB
testcase_15 AC 44 ms
48,900 KB
testcase_16 AC 44 ms
49,208 KB
testcase_17 AC 45 ms
49,568 KB
testcase_18 AC 45 ms
49,088 KB
testcase_19 AC 45 ms
49,192 KB
testcase_20 AC 45 ms
49,156 KB
testcase_21 AC 45 ms
49,152 KB
testcase_22 AC 45 ms
49,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String S = reader.readLine();
        StringBuilder builder =  new StringBuilder();
        for (int i = 0; i < S.length(); i++) {
            if(Character.isUpperCase(S.charAt(i))){
                builder.append(Character.toLowerCase(S.charAt(i)));
            } else {
                builder.append(Character.toUpperCase(S.charAt(i)));
            }
        }
        System.out.println(builder.toString());
    }
}
0