結果

問題 No.163 cAPSlOCK
ユーザー yugi0922yugi0922
提出日時 2020-07-01 08:25:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 720 bytes
コンパイル時間 3,339 ms
コンパイル使用メモリ 81,132 KB
実行使用メモリ 49,828 KB
最終ジャッジ日時 2023-10-11 21:59:13
合計ジャッジ時間 5,609 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
49,552 KB
testcase_01 AC 48 ms
49,664 KB
testcase_02 AC 47 ms
47,532 KB
testcase_03 AC 49 ms
49,524 KB
testcase_04 AC 48 ms
49,424 KB
testcase_05 AC 48 ms
49,496 KB
testcase_06 AC 47 ms
49,556 KB
testcase_07 AC 48 ms
49,456 KB
testcase_08 AC 49 ms
49,464 KB
testcase_09 AC 48 ms
47,720 KB
testcase_10 AC 48 ms
49,688 KB
testcase_11 AC 48 ms
49,628 KB
testcase_12 AC 48 ms
49,648 KB
testcase_13 AC 48 ms
49,544 KB
testcase_14 AC 48 ms
49,460 KB
testcase_15 AC 48 ms
49,792 KB
testcase_16 AC 50 ms
49,576 KB
testcase_17 AC 49 ms
49,828 KB
testcase_18 AC 49 ms
49,476 KB
testcase_19 AC 48 ms
49,632 KB
testcase_20 AC 48 ms
49,572 KB
testcase_21 AC 48 ms
49,384 KB
testcase_22 AC 50 ms
49,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import static java.lang.System.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class CapsLock {
	public static void main(String[] args) throws IOException {
		InputStreamReader re = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String str = reader.readLine();
		String result = "";
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase( str.charAt(i))){
				String c = String.valueOf(str.charAt(i));
				c = c.toLowerCase();
				result += c;
			}else{
				String c = String.valueOf(str.charAt(i));
				c = c.toUpperCase();
				result += c;

			}
		}
		System.out.println(result);
	}
}
0