結果

問題 No.163 cAPSlOCK
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:10:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 159 ms / 5,000 ms
コード長 361 bytes
コンパイル時間 3,324 ms
コンパイル使用メモリ 74,196 KB
実行使用メモリ 57,124 KB
最終ジャッジ日時 2023-08-10 00:06:33
合計ジャッジ時間 8,063 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
56,516 KB
testcase_01 AC 157 ms
56,608 KB
testcase_02 AC 157 ms
56,784 KB
testcase_03 AC 155 ms
57,004 KB
testcase_04 AC 154 ms
56,864 KB
testcase_05 AC 154 ms
56,800 KB
testcase_06 AC 155 ms
56,980 KB
testcase_07 AC 159 ms
56,904 KB
testcase_08 AC 159 ms
56,560 KB
testcase_09 AC 156 ms
56,608 KB
testcase_10 AC 157 ms
56,576 KB
testcase_11 AC 155 ms
56,804 KB
testcase_12 AC 157 ms
56,732 KB
testcase_13 AC 156 ms
56,444 KB
testcase_14 AC 158 ms
56,716 KB
testcase_15 AC 157 ms
57,124 KB
testcase_16 AC 157 ms
56,720 KB
testcase_17 AC 155 ms
56,744 KB
testcase_18 AC 154 ms
56,784 KB
testcase_19 AC 154 ms
56,600 KB
testcase_20 AC 155 ms
56,800 KB
testcase_21 AC 154 ms
56,784 KB
testcase_22 AC 155 ms
56,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		String s = sc.next(), ans = "";
		for(int i = 0; i < s.length(); i++){
			if(s.charAt(i) >= 'a'){
				ans += (char)(s.charAt(i)-'a'+'A');
			} else {
				ans += (char)(s.charAt(i)-'A'+'a');
			}
		}
		System.out.println(ans);
	}
}
0