結果

問題 No.163 cAPSlOCK
ユーザー ryosuke0825ryosuke0825
提出日時 2018-04-08 11:26:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 498 bytes
コンパイル時間 3,373 ms
コンパイル使用メモリ 72,020 KB
実行使用メモリ 56,360 KB
最終ジャッジ日時 2023-09-08 18:22:43
合計ジャッジ時間 7,521 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
54,280 KB
testcase_01 AC 116 ms
55,444 KB
testcase_02 AC 116 ms
55,708 KB
testcase_03 AC 118 ms
55,912 KB
testcase_04 AC 117 ms
55,552 KB
testcase_05 AC 117 ms
55,676 KB
testcase_06 AC 118 ms
56,016 KB
testcase_07 AC 116 ms
55,640 KB
testcase_08 AC 116 ms
55,268 KB
testcase_09 AC 116 ms
55,196 KB
testcase_10 AC 115 ms
55,216 KB
testcase_11 AC 116 ms
56,216 KB
testcase_12 AC 116 ms
55,620 KB
testcase_13 AC 117 ms
56,140 KB
testcase_14 AC 117 ms
55,288 KB
testcase_15 AC 120 ms
56,360 KB
testcase_16 AC 122 ms
55,872 KB
testcase_17 AC 117 ms
55,588 KB
testcase_18 AC 116 ms
55,820 KB
testcase_19 AC 121 ms
55,796 KB
testcase_20 AC 116 ms
55,852 KB
testcase_21 AC 114 ms
55,600 KB
testcase_22 AC 117 ms
55,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No163 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		StringBuilder str = new StringBuilder();

		char[] arr = S.toCharArray();
		for (char c : arr) {
			if (Character.isUpperCase(c)) {
				String s = String.valueOf(c);
				s = s.toLowerCase();
				str.append(s);
			}else {
				String s = String.valueOf(c);
				s = s.toUpperCase();
				str.append(s);
			}
		}
		System.out.println(str);

	}

}
0