結果

問題 No.163 cAPSlOCK
ユーザー kameyama_skameyama_s
提出日時 2023-04-21 13:30:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 472 bytes
コンパイル時間 1,748 ms
コンパイル使用メモリ 75,240 KB
実行使用メモリ 41,344 KB
最終ジャッジ日時 2024-04-24 02:25:19
合計ジャッジ時間 4,953 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
41,012 KB
testcase_01 AC 97 ms
40,644 KB
testcase_02 AC 99 ms
41,212 KB
testcase_03 AC 97 ms
39,740 KB
testcase_04 AC 101 ms
40,420 KB
testcase_05 AC 102 ms
41,344 KB
testcase_06 AC 104 ms
41,312 KB
testcase_07 AC 109 ms
40,916 KB
testcase_08 AC 117 ms
41,040 KB
testcase_09 AC 93 ms
39,680 KB
testcase_10 AC 106 ms
41,176 KB
testcase_11 AC 106 ms
41,100 KB
testcase_12 AC 105 ms
41,208 KB
testcase_13 AC 110 ms
40,096 KB
testcase_14 AC 99 ms
40,016 KB
testcase_15 AC 117 ms
41,248 KB
testcase_16 AC 117 ms
41,192 KB
testcase_17 AC 93 ms
39,668 KB
testcase_18 AC 103 ms
41,096 KB
testcase_19 AC 105 ms
40,904 KB
testcase_20 AC 104 ms
40,972 KB
testcase_21 AC 96 ms
40,088 KB
testcase_22 AC 103 ms
40,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;

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

        String s = sc.next();
        char[] strArray = s.toCharArray();
        for(char a : strArray){
        	if(Character.isLowerCase(a)){
        		System.out.print(Character.toUpperCase(a));
        	}
        	else{
        		System.out.print(Character.toLowerCase(a));
        	}
        }
    }
}
0