結果

問題 No.163 cAPSlOCK
ユーザー len_proglen_prog
提出日時 2016-06-02 22:55:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 3,246 ms
コンパイル使用メモリ 75,088 KB
実行使用メモリ 41,400 KB
最終ジャッジ日時 2024-04-16 23:23:56
合計ジャッジ時間 6,989 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,176 KB
testcase_01 AC 122 ms
41,136 KB
testcase_02 AC 119 ms
41,324 KB
testcase_03 AC 112 ms
41,204 KB
testcase_04 AC 123 ms
41,280 KB
testcase_05 AC 120 ms
40,984 KB
testcase_06 AC 122 ms
41,400 KB
testcase_07 AC 109 ms
41,004 KB
testcase_08 AC 127 ms
41,344 KB
testcase_09 AC 125 ms
40,860 KB
testcase_10 AC 127 ms
41,192 KB
testcase_11 AC 128 ms
41,044 KB
testcase_12 AC 111 ms
40,992 KB
testcase_13 AC 127 ms
41,004 KB
testcase_14 AC 128 ms
41,228 KB
testcase_15 AC 123 ms
41,248 KB
testcase_16 AC 131 ms
40,988 KB
testcase_17 AC 129 ms
41,356 KB
testcase_18 AC 131 ms
41,340 KB
testcase_19 AC 130 ms
41,168 KB
testcase_20 AC 123 ms
41,216 KB
testcase_21 AC 127 ms
41,048 KB
testcase_22 AC 113 ms
41,024 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