結果

問題 No.163 cAPSlOCK
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-05-11 04:10:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 507 bytes
コンパイル時間 4,574 ms
コンパイル使用メモリ 73,536 KB
実行使用メモリ 56,200 KB
最終ジャッジ日時 2023-09-10 12:14:32
合計ジャッジ時間 7,536 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,744 KB
testcase_01 AC 122 ms
55,928 KB
testcase_02 AC 121 ms
55,832 KB
testcase_03 AC 125 ms
55,924 KB
testcase_04 AC 124 ms
55,900 KB
testcase_05 AC 121 ms
55,532 KB
testcase_06 AC 123 ms
55,676 KB
testcase_07 AC 124 ms
55,772 KB
testcase_08 AC 124 ms
55,448 KB
testcase_09 AC 123 ms
55,616 KB
testcase_10 AC 122 ms
55,664 KB
testcase_11 AC 123 ms
55,956 KB
testcase_12 AC 122 ms
56,080 KB
testcase_13 AC 126 ms
55,764 KB
testcase_14 AC 126 ms
55,716 KB
testcase_15 AC 124 ms
55,816 KB
testcase_16 AC 126 ms
55,904 KB
testcase_17 AC 123 ms
55,584 KB
testcase_18 AC 121 ms
56,200 KB
testcase_19 AC 123 ms
55,956 KB
testcase_20 AC 123 ms
55,532 KB
testcase_21 AC 122 ms
56,044 KB
testcase_22 AC 124 ms
55,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class DealCaps{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String password = sc.next();
        String[] ps = password.split("");
        String PS = "";
        for(int i = 0; i < ps.length; i++){
            if(ps[i].toLowerCase().equals(ps[i])){
                PS += ps[i].toUpperCase();
            }else{
                PS += ps[i].toLowerCase();
            }
        }
        System.out.println(PS);
    }
}

0