結果

問題 No.163 cAPSlOCK
ユーザー gomagoma
提出日時 2017-09-19 20:56:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 404 bytes
コンパイル時間 1,904 ms
コンパイル使用メモリ 74,416 KB
実行使用メモリ 54,392 KB
最終ジャッジ日時 2024-04-25 18:18:34
合計ジャッジ時間 5,327 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
54,020 KB
testcase_01 AC 116 ms
54,020 KB
testcase_02 AC 116 ms
53,904 KB
testcase_03 AC 124 ms
54,176 KB
testcase_04 AC 125 ms
54,148 KB
testcase_05 AC 106 ms
52,980 KB
testcase_06 AC 111 ms
53,100 KB
testcase_07 AC 118 ms
52,840 KB
testcase_08 AC 109 ms
53,040 KB
testcase_09 AC 114 ms
54,012 KB
testcase_10 AC 112 ms
53,876 KB
testcase_11 AC 101 ms
52,780 KB
testcase_12 AC 122 ms
54,180 KB
testcase_13 AC 119 ms
54,348 KB
testcase_14 AC 123 ms
54,132 KB
testcase_15 AC 119 ms
54,008 KB
testcase_16 AC 107 ms
52,764 KB
testcase_17 AC 118 ms
54,288 KB
testcase_18 AC 113 ms
54,204 KB
testcase_19 AC 99 ms
53,060 KB
testcase_20 AC 114 ms
54,192 KB
testcase_21 AC 112 ms
53,960 KB
testcase_22 AC 113 ms
54,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		char[] ans = str.toCharArray();

		for (int i = 0; i < str.length(); i++) {
			if (Character.isUpperCase(ans[i])) {
				System.out.print(Character.toLowerCase(ans[i]));
			} else {
				System.out.print(Character.toUpperCase(ans[i]));
			}
		}
	}
}
0