結果

問題 No.163 cAPSlOCK
ユーザー h_tyokinuhatah_tyokinuhata
提出日時 2016-01-24 14:05:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 568 bytes
コンパイル時間 2,293 ms
コンパイル使用メモリ 74,896 KB
実行使用メモリ 57,676 KB
最終ジャッジ日時 2023-10-21 13:56:36
合計ジャッジ時間 6,269 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
57,408 KB
testcase_01 AC 126 ms
57,396 KB
testcase_02 AC 124 ms
57,408 KB
testcase_03 AC 133 ms
57,308 KB
testcase_04 AC 132 ms
57,360 KB
testcase_05 AC 125 ms
57,428 KB
testcase_06 AC 128 ms
57,376 KB
testcase_07 AC 133 ms
55,464 KB
testcase_08 AC 134 ms
57,628 KB
testcase_09 AC 132 ms
57,676 KB
testcase_10 AC 128 ms
57,280 KB
testcase_11 AC 127 ms
57,396 KB
testcase_12 AC 131 ms
57,456 KB
testcase_13 AC 132 ms
57,528 KB
testcase_14 AC 133 ms
57,456 KB
testcase_15 AC 131 ms
57,436 KB
testcase_16 AC 134 ms
57,612 KB
testcase_17 AC 131 ms
57,508 KB
testcase_18 AC 125 ms
57,392 KB
testcase_19 AC 126 ms
57,396 KB
testcase_20 AC 128 ms
57,404 KB
testcase_21 AC 126 ms
57,456 KB
testcase_22 AC 133 ms
57,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

		String s = sc.next();
		
		char[] charS = s.toCharArray();
		
		for(int i = 0; i < s.length(); i++) {
			if(String.valueOf(charS[i]).equals(String.valueOf(charS[i]).toUpperCase())) {
				charS[i] = String.valueOf(charS[i]).toLowerCase().charAt(0);
			} else {
				charS[i] = String.valueOf(charS[i]).toUpperCase().charAt(0);
			}
		}
		
		for(int i = 0; i < s.length(); i++) {
			System.out.print(charS[i]);
		}
		
		System.out.println();
	}
}
0