結果

問題 No.163 cAPSlOCK
ユーザー DevbotBotDevbotBot
提出日時 2015-06-24 16:03:30
言語 Java19
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 420 bytes
コンパイル時間 3,312 ms
コンパイル使用メモリ 72,904 KB
実行使用メモリ 56,304 KB
最終ジャッジ日時 2023-09-22 00:30:55
合計ジャッジ時間 7,398 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,952 KB
testcase_01 AC 123 ms
55,708 KB
testcase_02 AC 121 ms
55,684 KB
testcase_03 AC 126 ms
55,796 KB
testcase_04 AC 125 ms
55,772 KB
testcase_05 AC 119 ms
55,492 KB
testcase_06 AC 122 ms
55,792 KB
testcase_07 AC 123 ms
55,832 KB
testcase_08 AC 125 ms
56,304 KB
testcase_09 AC 124 ms
56,100 KB
testcase_10 AC 122 ms
55,636 KB
testcase_11 AC 121 ms
55,932 KB
testcase_12 AC 123 ms
56,068 KB
testcase_13 AC 124 ms
53,980 KB
testcase_14 AC 123 ms
55,720 KB
testcase_15 AC 122 ms
55,660 KB
testcase_16 AC 125 ms
55,776 KB
testcase_17 AC 122 ms
55,792 KB
testcase_18 AC 124 ms
56,168 KB
testcase_19 AC 122 ms
55,708 KB
testcase_20 AC 123 ms
56,156 KB
testcase_21 AC 119 ms
55,824 KB
testcase_22 AC 126 ms
55,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class No163 {
    public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		String j ;
		for(int i = 0; i < s.length; i++){
			j = String.valueOf(s[i]);
			if (j.matches( "[a-z]+" )){
				j = j.toUpperCase();
				s[i] = j.charAt(0);
			} else {
				j = j.toLowerCase();
				s[i] = j.charAt(0);
			}
		}
		System.out.println(s);
		}
}
0