結果

問題 No.163 cAPSlOCK
ユーザー syusyu
提出日時 2020-08-25 19:27:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 556 bytes
コンパイル時間 2,425 ms
コンパイル使用メモリ 77,144 KB
実行使用メモリ 41,620 KB
最終ジャッジ日時 2024-04-24 04:45:49
合計ジャッジ時間 5,312 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
40,720 KB
testcase_01 AC 95 ms
40,236 KB
testcase_02 AC 104 ms
41,312 KB
testcase_03 AC 109 ms
41,364 KB
testcase_04 AC 108 ms
41,356 KB
testcase_05 AC 110 ms
41,360 KB
testcase_06 AC 106 ms
41,364 KB
testcase_07 AC 105 ms
41,084 KB
testcase_08 AC 136 ms
41,328 KB
testcase_09 AC 133 ms
40,220 KB
testcase_10 AC 109 ms
41,316 KB
testcase_11 AC 108 ms
41,176 KB
testcase_12 AC 103 ms
40,668 KB
testcase_13 AC 97 ms
40,208 KB
testcase_14 AC 109 ms
41,336 KB
testcase_15 AC 114 ms
41,620 KB
testcase_16 AC 99 ms
39,920 KB
testcase_17 AC 109 ms
41,376 KB
testcase_18 AC 117 ms
41,368 KB
testcase_19 AC 105 ms
40,240 KB
testcase_20 AC 99 ms
39,920 KB
testcase_21 AC 108 ms
41,052 KB
testcase_22 AC 100 ms
40,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String wrongPass=sc.nextLine();
        
        String pass="";
        for(int i=0;i<wrongPass.length();i++){
            char checkWord=wrongPass.charAt(i);
            if(Character.isUpperCase(checkWord)){
                pass+=String.valueOf(checkWord).toLowerCase();
            }else{
                pass+=String.valueOf(checkWord).toUpperCase();
            }
        }
        System.out.println(pass);
    }
}
0