結果

問題 No.163 cAPSlOCK
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-14 00:14:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 491 bytes
コンパイル時間 2,413 ms
コンパイル使用メモリ 74,276 KB
実行使用メモリ 55,996 KB
最終ジャッジ日時 2023-08-17 04:30:31
合計ジャッジ時間 7,127 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,552 KB
testcase_01 AC 125 ms
55,748 KB
testcase_02 AC 123 ms
55,704 KB
testcase_03 AC 125 ms
55,708 KB
testcase_04 AC 127 ms
55,940 KB
testcase_05 AC 123 ms
55,468 KB
testcase_06 AC 127 ms
55,928 KB
testcase_07 AC 126 ms
55,776 KB
testcase_08 AC 126 ms
55,996 KB
testcase_09 AC 124 ms
55,476 KB
testcase_10 AC 126 ms
55,636 KB
testcase_11 AC 124 ms
55,740 KB
testcase_12 AC 125 ms
55,436 KB
testcase_13 AC 126 ms
55,724 KB
testcase_14 AC 126 ms
55,780 KB
testcase_15 AC 125 ms
55,724 KB
testcase_16 AC 126 ms
55,832 KB
testcase_17 AC 123 ms
55,916 KB
testcase_18 AC 124 ms
55,740 KB
testcase_19 AC 127 ms
55,996 KB
testcase_20 AC 121 ms
55,472 KB
testcase_21 AC 119 ms
55,748 KB
testcase_22 AC 120 ms
55,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String [] arr = S.split("");
        String s = "";
        for(int i=0; i<S.length(); i++){
            if( S.charAt(i)>='A' && 'Z'>=S.charAt(i)){
                s = s + arr[i].toLowerCase();
            }else{
                s = s + arr[i].toUpperCase();
            }
        }
        System.out.println(s);
    }
}
0