結果

問題 No.163 cAPSlOCK
ユーザー clamdclamd
提出日時 2016-12-11 07:35:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 455 bytes
コンパイル時間 6,151 ms
コンパイル使用メモリ 74,148 KB
実行使用メモリ 54,076 KB
最終ジャッジ日時 2024-11-29 02:26:31
合計ジャッジ時間 7,853 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
53,936 KB
testcase_01 AC 132 ms
53,652 KB
testcase_02 AC 132 ms
53,760 KB
testcase_03 AC 139 ms
53,876 KB
testcase_04 AC 141 ms
53,800 KB
testcase_05 AC 134 ms
53,980 KB
testcase_06 AC 133 ms
53,820 KB
testcase_07 AC 139 ms
53,876 KB
testcase_08 AC 139 ms
53,892 KB
testcase_09 AC 136 ms
53,760 KB
testcase_10 AC 134 ms
53,704 KB
testcase_11 AC 132 ms
53,900 KB
testcase_12 AC 137 ms
53,864 KB
testcase_13 AC 136 ms
53,864 KB
testcase_14 AC 133 ms
53,668 KB
testcase_15 AC 134 ms
53,840 KB
testcase_16 AC 139 ms
53,780 KB
testcase_17 AC 133 ms
53,744 KB
testcase_18 AC 132 ms
54,076 KB
testcase_19 AC 132 ms
53,856 KB
testcase_20 AC 131 ms
53,708 KB
testcase_21 AC 129 ms
53,956 KB
testcase_22 AC 140 ms
54,072 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