結果

問題 No.163 cAPSlOCK
ユーザー Fullmoon85072Fullmoon85072
提出日時 2020-08-01 20:16:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 377 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 71,360 KB
最終ジャッジ日時 2023-09-22 14:06:04
合計ジャッジ時間 3,370 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,284 KB
testcase_01 AC 72 ms
71,236 KB
testcase_02 AC 71 ms
71,340 KB
testcase_03 AC 74 ms
71,184 KB
testcase_04 AC 72 ms
71,164 KB
testcase_05 AC 72 ms
71,308 KB
testcase_06 AC 70 ms
71,208 KB
testcase_07 AC 73 ms
71,060 KB
testcase_08 AC 74 ms
71,304 KB
testcase_09 AC 72 ms
71,172 KB
testcase_10 AC 73 ms
71,184 KB
testcase_11 AC 73 ms
71,040 KB
testcase_12 AC 72 ms
71,136 KB
testcase_13 AC 73 ms
71,288 KB
testcase_14 AC 72 ms
71,160 KB
testcase_15 AC 71 ms
70,928 KB
testcase_16 AC 71 ms
71,272 KB
testcase_17 AC 73 ms
71,324 KB
testcase_18 AC 73 ms
71,276 KB
testcase_19 AC 71 ms
71,220 KB
testcase_20 AC 73 ms
71,360 KB
testcase_21 AC 73 ms
71,068 KB
testcase_22 AC 73 ms
71,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# アスキーコード
# a = 97
# z = 122
# A = 65
# Z = 90

S = input()
convert_str = ""
for ch in S:
    ascii_ch = ord(ch)

    # 小文字 -> 大文字
    if 97 <= ascii_ch and ascii_ch <= 122:
        convert_str += chr(ascii_ch - 32)

    # 大文字 -> 小文字
    elif 65 <= ascii_ch and ascii_ch <= 90:
        convert_str += chr(ascii_ch + 32)

print(convert_str)
0