ABC086A - Product

昨日から始めた AtCoder。まずは AtCoder Beginners Selection を上から順に解いていく。 お次はこれ。

atcoder.jp

偶数かどうかを判定するには、2 で割った余りが 0 かどうかを見ればいい。今回は特に変わった解き方をせずシンプルに。

using System;
 
namespace ABC086A
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var a = int.Parse(input[0]);
            var b = int.Parse(input[1]);
            if ((a * b) % 2 == 0)
            {
                Console.WriteLine("Even");
            }
            else
            {
                Console.WriteLine("Odd");
            }
        }
    }
}