結果

問題 No.163 cAPSlOCK
ユーザー r.suzukir.suzuki
提出日時 2015-12-08 15:36:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 444 bytes
コンパイル時間 3,384 ms
コンパイル使用メモリ 72,268 KB
実行使用メモリ 56,372 KB
最終ジャッジ日時 2023-10-12 21:54:13
合計ジャッジ時間 7,318 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,372 KB
testcase_01 AC 119 ms
55,584 KB
testcase_02 AC 122 ms
55,396 KB
testcase_03 AC 127 ms
55,832 KB
testcase_04 AC 129 ms
56,008 KB
testcase_05 AC 121 ms
55,600 KB
testcase_06 AC 121 ms
55,888 KB
testcase_07 AC 125 ms
56,128 KB
testcase_08 AC 125 ms
55,732 KB
testcase_09 AC 125 ms
55,920 KB
testcase_10 AC 120 ms
55,764 KB
testcase_11 AC 118 ms
55,824 KB
testcase_12 AC 123 ms
55,304 KB
testcase_13 AC 126 ms
55,712 KB
testcase_14 AC 124 ms
55,984 KB
testcase_15 AC 124 ms
55,704 KB
testcase_16 AC 127 ms
55,704 KB
testcase_17 AC 125 ms
55,984 KB
testcase_18 AC 121 ms
56,020 KB
testcase_19 AC 120 ms
56,092 KB
testcase_20 AC 121 ms
55,584 KB
testcase_21 AC 118 ms
55,916 KB
testcase_22 AC 127 ms
56,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No_163 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String password = sc.next();
		char[] pieceOfPassword = password.toCharArray();
		
		for(char c:pieceOfPassword){
			char cLow = Character.toLowerCase(c);
			if(c == cLow){
				System.out.print(Character.toUpperCase(c));
			}
			else{
				System.out.print(Character.toLowerCase(c));
			}
		}
		sc.close();
	}

}
0