LoginSignup
1
0

More than 1 year has passed since last update.

paiza.ioでelixir その16

Posted at

概要

paiza.ioでelixirやってみた。
atcoderやってみた。

参考にしたページ

問題

image.png

サンプルコード

defmodule Main do
	def f(h, m, s), do: 3600 * h + 60 * m + s
	defp solve([a, b, c, d]) do
		if f(a, b, 0) < f(c, d, 1), do: "Takahashi", else: "Aoki"
	end
	defp integer_list(str) do
		str
		|> String.trim()
		|> String.split(" ")
		|> Enum.map(&String.to_integer/1)
	end
	def main do
		IO.read(:line) 
		|> integer_list()
		|> solve()
		|> IO.puts()
	end
end
Main.main

成果物

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0