結果

問題 No.163 cAPSlOCK
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:10:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 162 ms / 5,000 ms
コード長 361 bytes
コンパイル時間 3,427 ms
コンパイル使用メモリ 76,284 KB
実行使用メモリ 55,120 KB
最終ジャッジ日時 2024-04-27 18:11:35
合計ジャッジ時間 8,395 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
54,868 KB
testcase_01 AC 157 ms
54,872 KB
testcase_02 AC 161 ms
54,884 KB
testcase_03 AC 157 ms
54,720 KB
testcase_04 AC 161 ms
54,936 KB
testcase_05 AC 162 ms
54,784 KB
testcase_06 AC 158 ms
54,860 KB
testcase_07 AC 160 ms
55,004 KB
testcase_08 AC 159 ms
54,916 KB
testcase_09 AC 158 ms
54,844 KB
testcase_10 AC 158 ms
54,764 KB
testcase_11 AC 160 ms
54,984 KB
testcase_12 AC 158 ms
54,780 KB
testcase_13 AC 158 ms
54,896 KB
testcase_14 AC 156 ms
54,716 KB
testcase_15 AC 156 ms
54,976 KB
testcase_16 AC 159 ms
54,844 KB
testcase_17 AC 159 ms
55,016 KB
testcase_18 AC 156 ms
55,120 KB
testcase_19 AC 156 ms
54,772 KB
testcase_20 AC 157 ms
54,956 KB
testcase_21 AC 156 ms
54,812 KB
testcase_22 AC 145 ms
54,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next(), ans = "";
		for(int i = 0; i < s.length(); i++){
			if(s.charAt(i) >= 'a'){
				ans += (char)(s.charAt(i)-'a'+'A');
			} else {
				ans += (char)(s.charAt(i)-'A'+'a');
			}
		}
		System.out.println(ans);
	}
}
0