結果

問題 No.163 cAPSlOCK
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-18 20:28:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 399 bytes
コンパイル時間 2,197 ms
コンパイル使用メモリ 76,756 KB
実行使用メモリ 41,576 KB
最終ジャッジ日時 2024-04-29 11:56:37
合計ジャッジ時間 6,020 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,280 KB
testcase_01 AC 128 ms
41,364 KB
testcase_02 AC 123 ms
40,952 KB
testcase_03 AC 111 ms
39,996 KB
testcase_04 AC 113 ms
40,104 KB
testcase_05 AC 125 ms
41,040 KB
testcase_06 AC 126 ms
40,876 KB
testcase_07 AC 118 ms
40,620 KB
testcase_08 AC 128 ms
41,388 KB
testcase_09 AC 127 ms
41,172 KB
testcase_10 AC 126 ms
40,900 KB
testcase_11 AC 130 ms
41,024 KB
testcase_12 AC 124 ms
40,916 KB
testcase_13 AC 125 ms
41,236 KB
testcase_14 AC 130 ms
41,328 KB
testcase_15 AC 126 ms
40,900 KB
testcase_16 AC 126 ms
41,004 KB
testcase_17 AC 127 ms
41,304 KB
testcase_18 AC 129 ms
41,004 KB
testcase_19 AC 129 ms
41,576 KB
testcase_20 AC 124 ms
40,980 KB
testcase_21 AC 133 ms
41,160 KB
testcase_22 AC 129 ms
41,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int n = s.length();
		String ans = "";
		for(int i = 0 ; i < n ; i++) {
			ans += Character.isUpperCase(s.charAt(i)) ? String.valueOf(s.charAt(i)).toLowerCase() : String.valueOf(s.charAt(i)).toUpperCase();
		}
		System.out.println(ans);
 	}
}

0