結果

問題 No.163 cAPSlOCK
ユーザー clamdclamd
提出日時 2016-12-11 07:22:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 2,768 ms
コンパイル使用メモリ 72,748 KB
実行使用メモリ 56,588 KB
最終ジャッジ日時 2023-08-19 10:40:43
合計ジャッジ時間 6,469 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
55,592 KB
testcase_01 AC 99 ms
55,408 KB
testcase_02 AC 101 ms
55,912 KB
testcase_03 AC 109 ms
56,212 KB
testcase_04 AC 108 ms
55,920 KB
testcase_05 AC 100 ms
55,836 KB
testcase_06 AC 100 ms
55,896 KB
testcase_07 AC 106 ms
56,196 KB
testcase_08 AC 109 ms
55,840 KB
testcase_09 AC 104 ms
55,856 KB
testcase_10 AC 104 ms
55,672 KB
testcase_11 AC 102 ms
56,068 KB
testcase_12 AC 105 ms
55,756 KB
testcase_13 AC 104 ms
56,588 KB
testcase_14 AC 110 ms
53,832 KB
testcase_15 AC 107 ms
55,656 KB
testcase_16 AC 112 ms
55,832 KB
testcase_17 AC 114 ms
55,560 KB
testcase_18 AC 106 ms
56,316 KB
testcase_19 AC 109 ms
55,792 KB
testcase_20 AC 109 ms
55,672 KB
testcase_21 AC 102 ms
56,112 KB
testcase_22 AC 109 ms
55,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class changeUpperLower {

	public static void main(String[] args) {
		Scanner sn = new Scanner(System.in);
		String s = sn.next();
		char[] reverse = s.toCharArray();
		for (int i = 0; i < s.length(); i++) {
			if (Character.isLowerCase(reverse[i])) {
				reverse[i] = Character.toUpperCase(reverse[i]);
			} else {
				reverse[i] = Character.toLowerCase(reverse[i]);
			}
			System.out.print(reverse[i]);
		}

	}

}
0