結果

問題 No.163 cAPSlOCK
ユーザー k_kadorak_kadora
提出日時 2015-05-27 14:23:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 168 ms / 5,000 ms
コード長 412 bytes
コンパイル時間 3,586 ms
コンパイル使用メモリ 74,244 KB
実行使用メモリ 58,640 KB
最終ジャッジ日時 2023-09-20 15:48:37
合計ジャッジ時間 8,675 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
56,432 KB
testcase_01 AC 159 ms
56,792 KB
testcase_02 AC 159 ms
56,580 KB
testcase_03 AC 161 ms
56,716 KB
testcase_04 AC 162 ms
56,928 KB
testcase_05 AC 158 ms
56,948 KB
testcase_06 AC 160 ms
56,644 KB
testcase_07 AC 159 ms
56,988 KB
testcase_08 AC 160 ms
57,096 KB
testcase_09 AC 159 ms
56,696 KB
testcase_10 AC 159 ms
56,636 KB
testcase_11 AC 160 ms
56,736 KB
testcase_12 AC 159 ms
56,764 KB
testcase_13 AC 160 ms
58,640 KB
testcase_14 AC 160 ms
56,428 KB
testcase_15 AC 159 ms
56,912 KB
testcase_16 AC 168 ms
56,956 KB
testcase_17 AC 158 ms
56,720 KB
testcase_18 AC 155 ms
56,440 KB
testcase_19 AC 157 ms
54,536 KB
testcase_20 AC 156 ms
56,800 KB
testcase_21 AC 158 ms
56,856 KB
testcase_22 AC 160 ms
56,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Caps {
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		String in = sc.next();
		int n = in.length();
		String out = "";
		for(int i = 0;i<n;i++){
			if(Character.isUpperCase(in.charAt(i))){
				out = out + Character.toLowerCase(in.charAt(i));
			}else{
				out = out + Character.toUpperCase(in.charAt(i));
			}
		}
		System.out.println(out);
	}
}
0