結果

問題 No.163 cAPSlOCK
ユーザー bigbear90560bigbear90560
提出日時 2015-07-03 00:37:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 618 bytes
コンパイル時間 3,694 ms
コンパイル使用メモリ 72,828 KB
実行使用メモリ 56,076 KB
最終ジャッジ日時 2023-09-22 05:48:56
合計ジャッジ時間 7,857 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,508 KB
testcase_01 AC 123 ms
55,780 KB
testcase_02 AC 124 ms
55,924 KB
testcase_03 AC 125 ms
56,068 KB
testcase_04 AC 124 ms
55,788 KB
testcase_05 AC 123 ms
55,860 KB
testcase_06 AC 122 ms
55,780 KB
testcase_07 AC 122 ms
55,732 KB
testcase_08 AC 124 ms
55,932 KB
testcase_09 AC 123 ms
55,780 KB
testcase_10 AC 125 ms
55,896 KB
testcase_11 AC 125 ms
55,836 KB
testcase_12 AC 123 ms
55,912 KB
testcase_13 AC 123 ms
55,796 KB
testcase_14 AC 124 ms
55,784 KB
testcase_15 AC 123 ms
56,076 KB
testcase_16 AC 123 ms
55,740 KB
testcase_17 AC 124 ms
55,732 KB
testcase_18 AC 123 ms
56,068 KB
testcase_19 AC 123 ms
55,740 KB
testcase_20 AC 125 ms
55,904 KB
testcase_21 AC 124 ms
55,864 KB
testcase_22 AC 125 ms
55,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * No.163 cAPSlOCK
 */
public class UToLOrLtoU {

	public static void main(String[] args) {

        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        // 文字列をchar型配列に分解
        char[] ca = s.toCharArray();
        StringBuilder sb = new StringBuilder();
        
        for (char c : ca) {
        	sb.append(Character.isUpperCase(c) ? Character.toLowerCase(c) : Character.toUpperCase(c));
        }
        System.out.println(sb.toString());
	}

}
0