結果

問題 No.163 cAPSlOCK
ユーザー eagleeagle
提出日時 2022-05-26 15:02:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 169 ms / 5,000 ms
コード長 536 bytes
コンパイル時間 2,417 ms
コンパイル使用メモリ 77,120 KB
実行使用メモリ 58,592 KB
最終ジャッジ日時 2023-10-20 19:27:14
合計ジャッジ時間 7,382 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
58,324 KB
testcase_01 AC 166 ms
58,328 KB
testcase_02 AC 166 ms
58,140 KB
testcase_03 AC 169 ms
58,588 KB
testcase_04 AC 167 ms
58,400 KB
testcase_05 AC 164 ms
58,320 KB
testcase_06 AC 164 ms
58,308 KB
testcase_07 AC 165 ms
58,540 KB
testcase_08 AC 165 ms
58,440 KB
testcase_09 AC 160 ms
58,344 KB
testcase_10 AC 167 ms
58,428 KB
testcase_11 AC 163 ms
58,372 KB
testcase_12 AC 161 ms
58,344 KB
testcase_13 AC 162 ms
58,340 KB
testcase_14 AC 166 ms
58,372 KB
testcase_15 AC 163 ms
58,448 KB
testcase_16 AC 164 ms
58,592 KB
testcase_17 AC 168 ms
58,324 KB
testcase_18 AC 166 ms
58,364 KB
testcase_19 AC 166 ms
58,400 KB
testcase_20 AC 169 ms
58,188 KB
testcase_21 AC 162 ms
58,332 KB
testcase_22 AC 163 ms
58,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String ans = "";
		for(int i = 0; i < s.length(); i++) {
			//文字を取り出す
			char c = s.charAt(i);
			//取り出した文字田が大文字なら
			if(Character.isUpperCase(c)) {
				c = Character.toLowerCase(c);
			} else {
				c = Character.toUpperCase(c);
			}
			ans += c;
		}
		System.out.println(ans);
	}
}
0