結果

問題 No.9001 標準入出力の練習問題(テスト用)
ユーザー yukicco
提出日時 2018-11-16 22:37:53
言語 Elixir
(1.18.1)
結果
AC  
実行時間 563 ms / 1,000 ms
コード長 561 bytes
コンパイル時間 986 ms
コンパイル使用メモリ 63,364 KB
実行使用メモリ 55,560 KB
最終ジャッジ日時 2024-12-31 02:24:40
合計ジャッジ時間 3,093 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
    def getsAll(device \\ :stdio, prompt), do: getsAll(device, prompt, "")
    defp getsAll(device, prompt, input) do
        x = IO.gets(device, prompt)
        case x do
            {:error, _} -> x
            :eof -> input
            _ -> getsAll(device, prompt, input <> x)
        end
    end
    def main do

        inputs = getsAll(nil) |> String.split

        [a, b] = inputs |> Enum.slice(0..1) |> Enum.map(&(String.to_integer(&1)))
        s = inputs |> Enum.slice(2..-1)

        IO.puts Enum.join([a + b, s], " ")

    end
end
0