結果

問題 No.163 cAPSlOCK
ユーザー 3qvwn3qvwn
提出日時 2019-07-03 22:42:33
言語 Elixir
(1.16.2)
結果
AC  
実行時間 640 ms / 5,000 ms
コード長 286 bytes
コンパイル時間 1,094 ms
コンパイル使用メモリ 55,228 KB
実行使用メモリ 50,768 KB
最終ジャッジ日時 2023-08-29 23:38:57
合計ジャッジ時間 17,297 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 627 ms
50,204 KB
testcase_01 AC 616 ms
49,900 KB
testcase_02 AC 619 ms
49,788 KB
testcase_03 AC 621 ms
49,808 KB
testcase_04 AC 628 ms
50,248 KB
testcase_05 AC 623 ms
50,752 KB
testcase_06 AC 615 ms
50,356 KB
testcase_07 AC 618 ms
50,628 KB
testcase_08 AC 622 ms
50,384 KB
testcase_09 AC 610 ms
50,404 KB
testcase_10 AC 616 ms
49,840 KB
testcase_11 AC 621 ms
49,756 KB
testcase_12 AC 626 ms
49,856 KB
testcase_13 AC 623 ms
50,440 KB
testcase_14 AC 626 ms
49,680 KB
testcase_15 AC 623 ms
49,864 KB
testcase_16 AC 630 ms
50,768 KB
testcase_17 AC 640 ms
49,700 KB
testcase_18 AC 628 ms
49,752 KB
testcase_19 AC 615 ms
49,796 KB
testcase_20 AC 621 ms
49,744 KB
testcase_21 AC 614 ms
50,344 KB
testcase_22 AC 606 ms
49,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do 
  def main do
    IO.gets("") |> String.trim |> String.codepoints |> Enum.map(&Main.updowncase(&1)) |> IO.puts
  end
  
  def updowncase(char) do
    if String.match?(char, ~r/[a-z]/) do
      String.upcase(char)
    else
      String.downcase(char)
    end
  end
end
0