結果

問題 No.163 cAPSlOCK
ユーザー shinwisteriashinwisteria
提出日時 2017-03-18 18:46:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 449 bytes
コンパイル時間 3,416 ms
コンパイル使用メモリ 72,652 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2023-09-18 02:32:08
合計ジャッジ時間 7,710 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,796 KB
testcase_01 AC 121 ms
55,828 KB
testcase_02 AC 122 ms
55,996 KB
testcase_03 AC 123 ms
55,876 KB
testcase_04 AC 122 ms
55,352 KB
testcase_05 AC 123 ms
55,696 KB
testcase_06 AC 123 ms
55,436 KB
testcase_07 AC 124 ms
55,588 KB
testcase_08 AC 122 ms
55,548 KB
testcase_09 AC 121 ms
55,592 KB
testcase_10 AC 120 ms
55,472 KB
testcase_11 AC 120 ms
55,592 KB
testcase_12 AC 121 ms
56,068 KB
testcase_13 AC 120 ms
55,612 KB
testcase_14 AC 121 ms
53,520 KB
testcase_15 AC 122 ms
55,628 KB
testcase_16 AC 123 ms
55,660 KB
testcase_17 AC 122 ms
56,000 KB
testcase_18 AC 123 ms
55,604 KB
testcase_19 AC 123 ms
55,792 KB
testcase_20 AC 124 ms
55,616 KB
testcase_21 AC 124 ms
55,580 KB
testcase_22 AC 121 ms
55,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Capslock {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		StringBuilder str = new StringBuilder(s.nextLine());
		s.close();
		
		for(int i = 0;i < str.length();i++){
			char 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