結果

問題 No.163 cAPSlOCK
ユーザー MatumoMatumo
提出日時 2018-07-13 03:10:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 2,692 ms
コンパイル使用メモリ 79,776 KB
実行使用メモリ 41,728 KB
最終ジャッジ日時 2024-04-15 11:00:37
合計ジャッジ時間 6,047 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,536 KB
testcase_01 AC 128 ms
41,244 KB
testcase_02 AC 130 ms
41,352 KB
testcase_03 AC 131 ms
41,512 KB
testcase_04 AC 129 ms
39,812 KB
testcase_05 AC 139 ms
41,096 KB
testcase_06 AC 131 ms
41,364 KB
testcase_07 AC 134 ms
41,604 KB
testcase_08 AC 133 ms
41,144 KB
testcase_09 AC 129 ms
41,492 KB
testcase_10 AC 130 ms
41,508 KB
testcase_11 AC 130 ms
41,100 KB
testcase_12 AC 130 ms
41,420 KB
testcase_13 AC 128 ms
41,344 KB
testcase_14 AC 129 ms
41,588 KB
testcase_15 AC 129 ms
41,420 KB
testcase_16 AC 130 ms
41,536 KB
testcase_17 AC 129 ms
41,472 KB
testcase_18 AC 134 ms
40,996 KB
testcase_19 AC 132 ms
41,368 KB
testcase_20 AC 132 ms
41,448 KB
testcase_21 AC 126 ms
41,728 KB
testcase_22 AC 134 ms
41,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		String s = sc.next();
		StringBuffer sb = new StringBuffer();

		for(int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if(Character.isUpperCase(c)) {
				sb.append(Character.toLowerCase(c));
			} else {
				sb.append(Character.toUpperCase(c));
			}
		}
		
		System.out.println(sb);
    }
}
0