結果

問題 No.163 cAPSlOCK
ユーザー Hiroaki KonoHiroaki Kono
提出日時 2017-10-26 21:14:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 563 bytes
コンパイル時間 4,008 ms
コンパイル使用メモリ 74,532 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-05-01 15:16:51
合計ジャッジ時間 7,082 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,488 KB
testcase_01 AC 125 ms
41,140 KB
testcase_02 AC 125 ms
41,284 KB
testcase_03 AC 128 ms
41,488 KB
testcase_04 AC 129 ms
41,600 KB
testcase_05 AC 128 ms
41,452 KB
testcase_06 AC 127 ms
41,092 KB
testcase_07 AC 126 ms
41,384 KB
testcase_08 AC 126 ms
41,412 KB
testcase_09 AC 123 ms
41,036 KB
testcase_10 AC 124 ms
41,196 KB
testcase_11 AC 124 ms
41,240 KB
testcase_12 AC 128 ms
41,584 KB
testcase_13 AC 124 ms
41,340 KB
testcase_14 AC 128 ms
41,472 KB
testcase_15 AC 126 ms
41,164 KB
testcase_16 AC 126 ms
41,212 KB
testcase_17 AC 125 ms
41,472 KB
testcase_18 AC 129 ms
41,124 KB
testcase_19 AC 128 ms
41,464 KB
testcase_20 AC 122 ms
41,448 KB
testcase_21 AC 124 ms
41,072 KB
testcase_22 AC 128 ms
40,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No163 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String password = s.next();
        char[] actual = new char[password.length()];
        for (int i = 0; i < password.length(); i++) {
            char c = password.charAt(i);
            if (Character.isUpperCase(c)) {
                actual[i] = Character.toLowerCase(c);
            } else {
                actual[i] = Character.toUpperCase(c);
            }
        }
        System.out.println(actual);
    }
}
0