結果

問題 No.163 cAPSlOCK
ユーザー jimanojimano
提出日時 2015-10-12 11:03:07
言語 Java19
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 426 bytes
コンパイル時間 3,269 ms
コンパイル使用メモリ 72,040 KB
実行使用メモリ 56,048 KB
最終ジャッジ日時 2023-09-28 12:38:23
合計ジャッジ時間 7,637 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,156 KB
testcase_01 AC 119 ms
55,856 KB
testcase_02 AC 120 ms
55,736 KB
testcase_03 AC 117 ms
55,592 KB
testcase_04 AC 120 ms
56,048 KB
testcase_05 AC 118 ms
55,800 KB
testcase_06 AC 118 ms
55,980 KB
testcase_07 AC 118 ms
55,940 KB
testcase_08 AC 119 ms
55,908 KB
testcase_09 AC 116 ms
55,604 KB
testcase_10 AC 118 ms
55,764 KB
testcase_11 AC 118 ms
54,216 KB
testcase_12 AC 121 ms
55,476 KB
testcase_13 AC 118 ms
55,876 KB
testcase_14 AC 119 ms
56,044 KB
testcase_15 AC 119 ms
55,936 KB
testcase_16 AC 121 ms
55,912 KB
testcase_17 AC 119 ms
55,732 KB
testcase_18 AC 119 ms
55,396 KB
testcase_19 AC 120 ms
55,808 KB
testcase_20 AC 122 ms
55,468 KB
testcase_21 AC 118 ms
53,072 KB
testcase_22 AC 119 ms
55,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No163 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] pass = sc.next().toCharArray();
		StringBuffer sb = new StringBuffer();

		for(char c : pass){
			if(Character.isLowerCase(c)){
				sb.append(Character.toUpperCase(c));
			}else if(Character.isUpperCase(c)){
				sb.append(Character.toLowerCase(c));
			}
		}
		System.out.println(sb);
	}
}
0