結果

問題 No.163 cAPSlOCK
ユーザー len_discoreglen_discoreg
提出日時 2016-06-02 21:14:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 3,374 ms
コンパイル使用メモリ 74,992 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-04-16 23:20:17
合計ジャッジ時間 7,331 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
40,960 KB
testcase_01 AC 124 ms
41,300 KB
testcase_02 AC 122 ms
41,284 KB
testcase_03 AC 126 ms
41,444 KB
testcase_04 AC 109 ms
40,924 KB
testcase_05 AC 125 ms
41,048 KB
testcase_06 AC 112 ms
41,184 KB
testcase_07 AC 125 ms
41,232 KB
testcase_08 AC 126 ms
41,008 KB
testcase_09 AC 133 ms
41,120 KB
testcase_10 AC 132 ms
41,268 KB
testcase_11 AC 124 ms
40,632 KB
testcase_12 AC 128 ms
41,044 KB
testcase_13 AC 128 ms
41,444 KB
testcase_14 AC 130 ms
41,112 KB
testcase_15 AC 126 ms
41,204 KB
testcase_16 AC 125 ms
41,500 KB
testcase_17 AC 126 ms
41,364 KB
testcase_18 AC 128 ms
41,096 KB
testcase_19 AC 125 ms
41,412 KB
testcase_20 AC 125 ms
41,088 KB
testcase_21 AC 122 ms
40,916 KB
testcase_22 AC 127 ms
40,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yuki163 {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String beforeStr = scan.next();

		char[] strArr = beforeStr.toCharArray();
		char[] convertedArr = new char[strArr.length];

		for(int i = 0; i < strArr.length; i++){
			if(Character.isUpperCase(strArr[i])){
				convertedArr[i] = Character.toLowerCase(strArr[i]);
			}else{
				convertedArr[i] = Character.toUpperCase(strArr[i]);
			}
		}

		String afterStr = String.valueOf(convertedArr);
		System.out.println(afterStr);
	}

}
0