結果

問題 No.163 cAPSlOCK
ユーザー hippolover02hippolover02
提出日時 2022-07-18 14:40:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 500 bytes
コンパイル時間 2,140 ms
コンパイル使用メモリ 72,040 KB
実行使用メモリ 56,320 KB
最終ジャッジ日時 2023-09-13 04:15:24
合計ジャッジ時間 6,325 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,852 KB
testcase_01 AC 117 ms
56,136 KB
testcase_02 AC 118 ms
55,568 KB
testcase_03 AC 118 ms
55,948 KB
testcase_04 AC 123 ms
55,496 KB
testcase_05 AC 117 ms
55,916 KB
testcase_06 AC 114 ms
55,796 KB
testcase_07 AC 120 ms
56,036 KB
testcase_08 AC 121 ms
56,116 KB
testcase_09 AC 120 ms
55,944 KB
testcase_10 AC 124 ms
56,032 KB
testcase_11 AC 123 ms
56,108 KB
testcase_12 AC 124 ms
55,804 KB
testcase_13 AC 124 ms
55,900 KB
testcase_14 AC 126 ms
56,320 KB
testcase_15 AC 125 ms
55,924 KB
testcase_16 AC 122 ms
55,532 KB
testcase_17 AC 121 ms
55,852 KB
testcase_18 AC 121 ms
56,208 KB
testcase_19 AC 121 ms
55,968 KB
testcase_20 AC 122 ms
56,184 KB
testcase_21 AC 126 ms
55,816 KB
testcase_22 AC 124 ms
55,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

        String plain = sc.nextLine();
        String[] str = plain.split("");

        for (int i=0;i<str.length;i++){
            // 大文字の時
            if(str[i].matches("[A-Z]")){
                str[i] = str[i].toLowerCase();
            }else {
                str[i] = str[i].toUpperCase();
            }
        }
		System.out.println(String.join("", str));
	}
}
0