結果

問題 No.163 cAPSlOCK
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 14:22:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 161 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 2,191 ms
コンパイル使用メモリ 74,276 KB
実行使用メモリ 58,836 KB
最終ジャッジ日時 2023-10-11 12:37:21
合計ジャッジ時間 7,219 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
56,996 KB
testcase_01 AC 158 ms
57,012 KB
testcase_02 AC 157 ms
56,924 KB
testcase_03 AC 159 ms
56,972 KB
testcase_04 AC 158 ms
54,860 KB
testcase_05 AC 156 ms
56,592 KB
testcase_06 AC 156 ms
57,088 KB
testcase_07 AC 157 ms
56,892 KB
testcase_08 AC 159 ms
56,656 KB
testcase_09 AC 156 ms
58,836 KB
testcase_10 AC 156 ms
56,760 KB
testcase_11 AC 156 ms
56,892 KB
testcase_12 AC 156 ms
57,212 KB
testcase_13 AC 155 ms
57,232 KB
testcase_14 AC 155 ms
56,948 KB
testcase_15 AC 161 ms
56,952 KB
testcase_16 AC 158 ms
57,176 KB
testcase_17 AC 157 ms
56,912 KB
testcase_18 AC 157 ms
56,592 KB
testcase_19 AC 158 ms
56,820 KB
testcase_20 AC 158 ms
56,600 KB
testcase_21 AC 157 ms
56,932 KB
testcase_22 AC 157 ms
57,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String s = sc.next();
		String ans = "";
		for (int i=0; i<s.length(); i++) {
			char c = s.charAt(i);
			if (Character.isUpperCase(c)) {
				ans += (char)(c + 32);
			}
			else {
				ans += (char)(c - 32);
			}
		}
		System.out.println(ans);
		
	}
}
0