結果

問題 No.163 cAPSlOCK
ユーザー GrenacheGrenache
提出日時 2015-06-30 19:13:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 542 bytes
コンパイル時間 3,069 ms
コンパイル使用メモリ 73,868 KB
実行使用メモリ 56,588 KB
最終ジャッジ日時 2023-09-22 04:43:26
合計ジャッジ時間 7,064 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,464 KB
testcase_01 AC 115 ms
55,512 KB
testcase_02 AC 117 ms
55,676 KB
testcase_03 AC 123 ms
55,340 KB
testcase_04 AC 123 ms
55,952 KB
testcase_05 AC 116 ms
56,072 KB
testcase_06 AC 117 ms
55,432 KB
testcase_07 AC 120 ms
55,636 KB
testcase_08 AC 121 ms
55,720 KB
testcase_09 AC 119 ms
55,440 KB
testcase_10 AC 115 ms
55,964 KB
testcase_11 AC 116 ms
55,388 KB
testcase_12 AC 120 ms
55,268 KB
testcase_13 AC 122 ms
55,768 KB
testcase_14 AC 123 ms
55,684 KB
testcase_15 AC 119 ms
55,740 KB
testcase_16 AC 120 ms
55,264 KB
testcase_17 AC 117 ms
55,484 KB
testcase_18 AC 116 ms
55,512 KB
testcase_19 AC 115 ms
55,448 KB
testcase_20 AC 117 ms
55,684 KB
testcase_21 AC 116 ms
55,264 KB
testcase_22 AC 123 ms
56,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder163 {

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

        char[] passwd = sc.next().toCharArray();

        for (int i = 0; i < passwd.length; i++) {
        	if (passwd[i] >= 'A' && passwd[i] <= 'Z') {
        		System.out.print((char)(passwd[i] - 'A' + 'a'));
        	} else {
        		System.out.print((char)(passwd[i] - 'a' + 'A'));
        	}
        }
        
        System.out.println("");
        
        sc.close();
    }
}

0