結果

問題 No.163 cAPSlOCK
ユーザー S1hoS1ho
提出日時 2017-02-19 14:21:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 652 bytes
コンパイル時間 5,336 ms
コンパイル使用メモリ 72,908 KB
実行使用メモリ 56,232 KB
最終ジャッジ日時 2023-08-28 19:12:20
合計ジャッジ時間 8,666 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
55,588 KB
testcase_01 AC 112 ms
55,784 KB
testcase_02 AC 112 ms
55,996 KB
testcase_03 AC 113 ms
55,952 KB
testcase_04 AC 113 ms
55,392 KB
testcase_05 AC 111 ms
55,520 KB
testcase_06 AC 111 ms
55,856 KB
testcase_07 AC 111 ms
56,124 KB
testcase_08 AC 113 ms
55,864 KB
testcase_09 AC 115 ms
56,008 KB
testcase_10 AC 111 ms
56,140 KB
testcase_11 AC 112 ms
55,960 KB
testcase_12 AC 111 ms
55,524 KB
testcase_13 AC 113 ms
55,928 KB
testcase_14 AC 115 ms
55,564 KB
testcase_15 AC 112 ms
55,800 KB
testcase_16 AC 115 ms
55,936 KB
testcase_17 AC 111 ms
55,628 KB
testcase_18 AC 111 ms
55,864 KB
testcase_19 AC 111 ms
55,632 KB
testcase_20 AC 112 ms
55,740 KB
testcase_21 AC 113 ms
55,652 KB
testcase_22 AC 113 ms
56,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class CapsLock {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        StringBuilder str = new StringBuilder();
        str.append(scanner.next());
      
        char c;
        
        for(int i=0;i<str.length();i++){
            
            c = str.charAt(i);
            
            if(Character.isUpperCase(c)){
                str.setCharAt(i, Character.toLowerCase(c));
            }else{
                str.setCharAt(i, Character.toUpperCase(c));
            }
            
        }
        
        System.out.println(str);
        
    }
    
}
0