結果

問題 No.163 cAPSlOCK
ユーザー springspring
提出日時 2019-06-12 13:40:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 468 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 74,656 KB
実行使用メモリ 41,712 KB
最終ジャッジ日時 2024-04-18 11:48:33
合計ジャッジ時間 5,737 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,584 KB
testcase_01 AC 115 ms
41,128 KB
testcase_02 AC 114 ms
41,564 KB
testcase_03 AC 124 ms
41,528 KB
testcase_04 AC 111 ms
41,200 KB
testcase_05 AC 117 ms
41,072 KB
testcase_06 AC 119 ms
41,020 KB
testcase_07 AC 129 ms
41,168 KB
testcase_08 AC 128 ms
40,980 KB
testcase_09 AC 120 ms
41,404 KB
testcase_10 AC 106 ms
41,712 KB
testcase_11 AC 114 ms
40,248 KB
testcase_12 AC 128 ms
41,300 KB
testcase_13 AC 120 ms
41,100 KB
testcase_14 AC 122 ms
41,212 KB
testcase_15 AC 119 ms
41,300 KB
testcase_16 AC 125 ms
41,116 KB
testcase_17 AC 115 ms
41,324 KB
testcase_18 AC 118 ms
41,320 KB
testcase_19 AC 125 ms
40,908 KB
testcase_20 AC 118 ms
40,964 KB
testcase_21 AC 113 ms
39,956 KB
testcase_22 AC 116 ms
41,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		char[] inputstr = input.toCharArray();
		for(char inputchar : inputstr){
			if(Character.isUpperCase(inputchar)){
				System.out.print(Character.toLowerCase(inputchar));
			}else{
				System.out.print(Character.toUpperCase(inputchar));
			}
		}
		System.out.println();
	}// mainmethod

} // class
0